From f70c1cdbd1462a0ffa0fbd1eda1f2625ca1b1f8c Mon Sep 17 00:00:00 2001 From: Hrishikesh Murali <41909835+enigmarikki@users.noreply.github.com> Date: Thu, 16 Jan 2025 19:57:24 -0500 Subject: [PATCH] feat: injective plugin (#1764) * "plugin: init injective integration and skeleton" * "wip : skeleton partially done" * "wip: finished fetch" * "chore : fix format" * "chore : renamed files" * "wip: completed grpc endpoints for onchain queries" * "chore : removed unwanted files" * "wip : adding templates + integrating onchain functions" * "wip : added inital version of templates" * "wip : testing the plugin" * "wip : skeleton for actions, providers" * "chore: renamed and fixed relative imports" * "wip : added message broadcasting rpcs" * "feat : finished initial version of message parsing and querying" * "chore : refactor package.json" * "chore: added chain message broadcasters to the InjectiveGrpcBase" * "wip : restructure actions and providers" * "chore : fix conflicts on lockfile" * "chore: added readme.md to use injective-sdk-client-ts" * "chore : renamed the package to ensure consistency and updated the docs" * "chore : refactored function args to make it easy to define function schema" * "fix : missing imports for wasm" * "wip : refactor injective types and templates" * "chore : refactored the types into different files for maintainability" * "chore : fmt" * "wip : refactor the responses for standard message parsing" * "chore : refactored all modules to ouput same a common message type" * "wip : minimal tests" * "fix: the grpc init + bug in making request" * "wip : done with skeleton templates" * "chore : reorgranize files" * "wip : adding exchange templates" * "chore : added fmt and finished comprehensive template for exchange module" * "wip: refactored templates for auction and bank" * "wip : almost done refactoring all the templates to add both the request, response" * "chore : renamed to gov for consistency and added the explorer module" * "fix : removed minor import into exchange" * "wip : added the base action" * "feat: finished integrating actions, wip fix for templates and examples" * "chore : refactored all the request and response templates" * "chore : fmt templates" * "chore : added modules examples except exchange, fixed a few relative imports" * "chore: finished integrating exchange examples" * "feat: finished all integrations for injective-plugin" * "fix : revert fmt" * "chore : bump injective-ts sdk version" * "fix : dependency issues" * "fix : complex dependency issue from esm imports" * "chore : refactored the rpc to take either inj address or eth address" * "wip: fixed rpc initialization" * "fix: Refactored action template" * "chore : resolve lock file conflicts" * "chore : added config params in .env.examples" * "wip : improve response prompts from agent" * "chore : refactored similes, for better interpretation" * "wip: integrated mito's constant product market maker - amm" * "feat: added Initial Dex offering and action, for agents to autonomously raise funds" * "chore : revert defaultCharacter to LLAMA" --------- Co-authored-by: rikki Co-authored-by: Odilitime --- .env.example | 4 + agent/package.json | 1 + agent/src/index.ts | 13 +- package.json | 1 + packages/plugin-injective/Readme.md | 176 + packages/plugin-injective/eslint.config.mjs | 3 + .../injective-sdk-client-ts/.eslintignore | 3 + .../injective-sdk-client-ts/.eslintrc.js | 23 + .../injective-sdk-client-ts/Readme.md | 190 + .../injective-sdk-client-ts/eslint.config.mjs | 37 + .../injective-sdk-client-ts/package.json | 50 + .../src/examples/auction.ts | 218 ++ .../src/examples/auth.ts | 313 ++ .../src/examples/bank.ts | 412 +++ .../src/examples/distribution.ts | 222 ++ .../src/examples/exchange.ts | 2304 ++++++++++++ .../src/examples/explorer.ts | 359 ++ .../src/examples/gov.ts | 373 ++ .../src/examples/ibc.ts | 102 + .../src/examples/insurance.ts | 210 ++ .../src/examples/mint.ts | 65 + .../src/examples/mito.ts | 1232 +++++++ .../src/examples/peggy.ts | 63 + .../src/examples/permissions.ts | 209 ++ .../src/examples/staking.ts | 726 ++++ .../src/examples/token-factory.ts | 192 + .../src/examples/wasm.ts | 608 ++++ .../src/exceptions/GrpcException.ts | 24 + .../src/exceptions/index.ts | 1 + .../src/grpc/grpc-base.ts | 242 ++ .../src/modules/Ibc.ts | 78 + .../src/modules/auction.ts | 128 + .../src/modules/auth.ts | 61 + .../src/modules/authz.ts | 141 + .../src/modules/bank.ts | 232 ++ .../src/modules/distribution.ts | 173 + .../src/modules/exchange.ts | 1679 +++++++++ .../src/modules/explorer.ts | 227 ++ .../src/modules/gov.ts | 350 ++ .../src/modules/index.ts | 408 +++ .../src/modules/insurance.ts | 197 ++ .../src/modules/mint.ts | 63 + .../src/modules/mito.ts | 763 ++++ .../src/modules/oracle.ts | 25 + .../src/modules/peggy.ts | 59 + .../src/modules/permissions.ts | 133 + .../src/modules/staking.ts | 500 +++ .../src/modules/token-factory.ts | 210 ++ .../src/modules/wasm.ts | 369 ++ .../src/modules/wasmx.ts | 44 + .../src/similes/auction.ts | 71 + .../src/similes/auth.ts | 107 + .../src/similes/bank.ts | 131 + .../src/similes/distribution.ts | 83 + .../src/similes/exchange.ts | 852 +++++ .../src/similes/explorer.ts | 131 + .../src/similes/gov.ts | 167 + .../src/similes/ibc.ts | 35 + .../src/similes/insurance.ts | 95 + .../src/similes/mint.ts | 35 + .../src/similes/mito.ts | 364 ++ .../src/similes/peggy.ts | 23 + .../src/similes/permissions.ts | 71 + .../src/similes/staking.ts | 279 ++ .../src/similes/token-factory.ts | 109 + .../src/similes/wasm.ts | 219 ++ .../src/template/auction.ts | 212 ++ .../src/template/auth.ts | 330 ++ .../src/template/bank.ts | 372 ++ .../src/template/base.ts | 31 + .../src/template/distribution.ts | 195 ++ .../src/template/exchange.ts | 3100 +++++++++++++++++ .../src/template/explorer.ts | 450 +++ .../src/template/gov.ts | 503 +++ .../src/template/ibc.ts | 135 + .../src/template/index.ts | 15 + .../src/template/insurance.ts | 246 ++ .../src/template/mint.ts | 65 + .../src/template/mito.ts | 1242 +++++++ .../src/template/peggy.ts | 99 + .../src/template/permissions.ts | 221 ++ .../src/template/staking.ts | 664 ++++ .../src/template/token-factory.ts | 227 ++ .../src/template/wasm.ts | 848 +++++ .../src/types/auction.ts | 13 + .../injective-sdk-client-ts/src/types/auth.ts | 60 + .../injective-sdk-client-ts/src/types/bank.ts | 99 + .../injective-sdk-client-ts/src/types/base.ts | 17 + .../src/types/distribution.ts | 41 + .../src/types/exchange.ts | 659 ++++ .../src/types/explorer.ts | 149 + .../injective-sdk-client-ts/src/types/gov.ts | 196 ++ .../injective-sdk-client-ts/src/types/ibc.ts | 48 + .../src/types/index.ts | 44 + .../src/types/insurance.ts | 78 + .../injective-sdk-client-ts/src/types/mint.ts | 14 + .../injective-sdk-client-ts/src/types/mito.ts | 542 +++ .../src/types/peggy.ts | 11 + .../src/types/permissions.ts | 69 + .../src/types/staking.ts | 175 + .../src/types/token-factory.ts | 63 + .../injective-sdk-client-ts/src/types/wasm.ts | 184 + .../injective-sdk-client-ts/tsconfig.json | 26 + .../injective-sdk-client-ts/tsup.config.ts | 48 + packages/plugin-injective/jest.config.js | 9 + packages/plugin-injective/package.json | 51 + .../plugin-injective/src/action/auction.ts | 72 + packages/plugin-injective/src/action/auth.ts | 107 + packages/plugin-injective/src/action/bank.ts | 129 + packages/plugin-injective/src/action/base.ts | 183 + .../src/action/distribution.ts | 91 + .../plugin-injective/src/action/exchange.ts | 847 +++++ .../plugin-injective/src/action/explorer.ts | 129 + packages/plugin-injective/src/action/gov.ts | 169 + packages/plugin-injective/src/action/ibc.ts | 41 + packages/plugin-injective/src/action/index.ts | 54 + .../plugin-injective/src/action/insurance.ts | 99 + packages/plugin-injective/src/action/mint.ts | 40 + packages/plugin-injective/src/action/mito.ts | 347 ++ packages/plugin-injective/src/action/peggy.ts | 29 + .../src/action/permissions.ts | 74 + .../plugin-injective/src/action/staking.ts | 280 ++ .../src/action/token-factory.ts | 111 + packages/plugin-injective/src/action/wasm.ts | 219 ++ packages/plugin-injective/src/index.ts | 11 + packages/plugin-injective/tsconfig.json | 24 + packages/plugin-injective/tsup.config.ts | 50 + pnpm-lock.yaml | 1950 +++++++++-- 128 files changed, 33252 insertions(+), 343 deletions(-) create mode 100644 packages/plugin-injective/Readme.md create mode 100644 packages/plugin-injective/eslint.config.mjs create mode 100644 packages/plugin-injective/injective-sdk-client-ts/.eslintignore create mode 100644 packages/plugin-injective/injective-sdk-client-ts/.eslintrc.js create mode 100644 packages/plugin-injective/injective-sdk-client-ts/Readme.md create mode 100644 packages/plugin-injective/injective-sdk-client-ts/eslint.config.mjs create mode 100644 packages/plugin-injective/injective-sdk-client-ts/package.json create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/examples/auction.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/examples/auth.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/examples/bank.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/examples/distribution.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/examples/exchange.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/examples/explorer.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/examples/gov.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/examples/ibc.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/examples/insurance.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/examples/mint.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/examples/mito.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/examples/peggy.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/examples/permissions.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/examples/staking.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/examples/token-factory.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/examples/wasm.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/exceptions/GrpcException.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/exceptions/index.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/grpc/grpc-base.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/modules/Ibc.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/modules/auction.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/modules/auth.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/modules/authz.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/modules/bank.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/modules/distribution.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/modules/exchange.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/modules/explorer.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/modules/gov.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/modules/index.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/modules/insurance.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/modules/mint.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/modules/mito.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/modules/oracle.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/modules/peggy.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/modules/permissions.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/modules/staking.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/modules/token-factory.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/modules/wasm.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/modules/wasmx.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/similes/auction.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/similes/auth.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/similes/bank.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/similes/distribution.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/similes/exchange.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/similes/explorer.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/similes/gov.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/similes/ibc.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/similes/insurance.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/similes/mint.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/similes/mito.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/similes/peggy.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/similes/permissions.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/similes/staking.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/similes/token-factory.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/similes/wasm.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/template/auction.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/template/auth.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/template/bank.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/template/base.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/template/distribution.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/template/exchange.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/template/explorer.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/template/gov.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/template/ibc.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/template/index.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/template/insurance.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/template/mint.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/template/mito.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/template/peggy.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/template/permissions.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/template/staking.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/template/token-factory.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/template/wasm.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/types/auction.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/types/auth.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/types/bank.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/types/base.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/types/distribution.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/types/exchange.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/types/explorer.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/types/gov.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/types/ibc.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/types/index.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/types/insurance.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/types/mint.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/types/mito.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/types/peggy.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/types/permissions.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/types/staking.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/types/token-factory.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/src/types/wasm.ts create mode 100644 packages/plugin-injective/injective-sdk-client-ts/tsconfig.json create mode 100644 packages/plugin-injective/injective-sdk-client-ts/tsup.config.ts create mode 100644 packages/plugin-injective/jest.config.js create mode 100644 packages/plugin-injective/package.json create mode 100644 packages/plugin-injective/src/action/auction.ts create mode 100644 packages/plugin-injective/src/action/auth.ts create mode 100644 packages/plugin-injective/src/action/bank.ts create mode 100644 packages/plugin-injective/src/action/base.ts create mode 100644 packages/plugin-injective/src/action/distribution.ts create mode 100644 packages/plugin-injective/src/action/exchange.ts create mode 100644 packages/plugin-injective/src/action/explorer.ts create mode 100644 packages/plugin-injective/src/action/gov.ts create mode 100644 packages/plugin-injective/src/action/ibc.ts create mode 100644 packages/plugin-injective/src/action/index.ts create mode 100644 packages/plugin-injective/src/action/insurance.ts create mode 100644 packages/plugin-injective/src/action/mint.ts create mode 100644 packages/plugin-injective/src/action/mito.ts create mode 100644 packages/plugin-injective/src/action/peggy.ts create mode 100644 packages/plugin-injective/src/action/permissions.ts create mode 100644 packages/plugin-injective/src/action/staking.ts create mode 100644 packages/plugin-injective/src/action/token-factory.ts create mode 100644 packages/plugin-injective/src/action/wasm.ts create mode 100644 packages/plugin-injective/src/index.ts create mode 100644 packages/plugin-injective/tsconfig.json create mode 100644 packages/plugin-injective/tsup.config.ts diff --git a/.env.example b/.env.example index c7c5cd4f437..c5c38d02245 100644 --- a/.env.example +++ b/.env.example @@ -309,6 +309,10 @@ SOLANA_ADMIN_PRIVATE_KEY= # This wallet is used to verify NFTs SOLANA_ADMIN_PUBLIC_KEY= # This wallet is used to verify NFTs SOLANA_VERIFY_TOKEN= # Authentication token for calling the verification API +# Injective +INJECTIVE_PRIVATE_KEY= # +INJECTIVE_PUBLIC_KEY= # +INJECTIVE_NETWORK= # # Fallback Wallet Configuration (deprecated) WALLET_PRIVATE_KEY= WALLET_PUBLIC_KEY= diff --git a/agent/package.json b/agent/package.json index 44c42c84a9b..929f9186ca6 100644 --- a/agent/package.json +++ b/agent/package.json @@ -61,6 +61,7 @@ "@elizaos/plugin-nft-generation": "workspace:*", "@elizaos/plugin-node": "workspace:*", "@elizaos/plugin-solana": "workspace:*", + "@elizaos/plugin-injective": "workspace:*", "@elizaos/plugin-solana-agentkit": "workspace:*", "@elizaos/plugin-squid-router": "workspace:*", "@elizaos/plugin-autonome": "workspace:*", diff --git a/agent/src/index.ts b/agent/src/index.ts index 6ba56bfecbb..2f4721c8f85 100644 --- a/agent/src/index.ts +++ b/agent/src/index.ts @@ -70,12 +70,9 @@ import { evmPlugin } from "@elizaos/plugin-evm"; import { flowPlugin } from "@elizaos/plugin-flow"; import { fuelPlugin } from "@elizaos/plugin-fuel"; import { genLayerPlugin } from "@elizaos/plugin-genlayer"; -import { giphyPlugin } from "@elizaos/plugin-giphy"; import { gitcoinPassportPlugin } from "@elizaos/plugin-gitcoin-passport"; -import { hyperliquidPlugin } from "@elizaos/plugin-hyperliquid"; import { imageGenerationPlugin } from "@elizaos/plugin-image-generation"; import { lensPlugin } from "@elizaos/plugin-lensNetwork"; -import { letzAIPlugin } from "@elizaos/plugin-letzai"; import { multiversxPlugin } from "@elizaos/plugin-multiversx"; import { nearPlugin } from "@elizaos/plugin-near"; import createNFTCollectionsPlugin from "@elizaos/plugin-nft-collections"; @@ -96,9 +93,13 @@ import { TEEMode, teePlugin } from "@elizaos/plugin-tee"; import { teeLogPlugin } from "@elizaos/plugin-tee-log"; import { teeMarlinPlugin } from "@elizaos/plugin-tee-marlin"; import { verifiableLogPlugin } from "@elizaos/plugin-tee-verifiable-log"; -import { thirdwebPlugin } from "@elizaos/plugin-thirdweb"; import { tonPlugin } from "@elizaos/plugin-ton"; import { webSearchPlugin } from "@elizaos/plugin-web-search"; +import { injectivePlugin } from "@elizaos/plugin-injective"; +import { giphyPlugin } from "@elizaos/plugin-giphy"; +import { letzAIPlugin } from "@elizaos/plugin-letzai"; +import { thirdwebPlugin } from "@elizaos/plugin-thirdweb"; +import { hyperliquidPlugin } from "@elizaos/plugin-hyperliquid"; import { echoChambersPlugin } from "@elizaos/plugin-echochambers"; import { dexScreenerPlugin } from "@elizaos/plugin-dexscreener"; @@ -806,6 +807,10 @@ export async function createAgent( getSecret(character, "WALLET_PUBLIC_KEY")?.startsWith("0x")) ? evmPlugin : null, + ((getSecret(character, "EVM_PUBLIC_KEY") || getSecret(character, "INJECTIVE_PUBLIC_KEY")) && + getSecret(character, "INJECTIVE_PRIVATE_KEY")) + ? injectivePlugin + : null, getSecret(character, "COSMOS_RECOVERY_PHRASE") && getSecret(character, "COSMOS_AVAILABLE_CHAINS") && createCosmosPlugin(), diff --git a/package.json b/package.json index af32159bf96..657c3eec6e3 100644 --- a/package.json +++ b/package.json @@ -61,6 +61,7 @@ "@0glabs/0g-ts-sdk": "0.2.1", "@coinbase/coinbase-sdk": "0.10.0", "@deepgram/sdk": "^3.9.0", + "@injectivelabs/sdk-ts": "^1.14.33", "@vitest/eslint-plugin": "1.0.1", "amqplib": "0.10.5", "csv-parse": "5.6.0", diff --git a/packages/plugin-injective/Readme.md b/packages/plugin-injective/Readme.md new file mode 100644 index 00000000000..d08ae4abf48 --- /dev/null +++ b/packages/plugin-injective/Readme.md @@ -0,0 +1,176 @@ +# @elizaos/plugin-injective + +A comprehensive plugin for interacting with the Injective chain through ElizaOS. + +## Project Structure + +``` +src/ +├── auction.ts # Auction module actions +├── auth.ts # Auth module actions +├── bank.ts # Bank module actions +├── distribution.ts # Distribution module actions +├── exchange.ts # Exchange module actions +├── explorer.ts # Explorer module actions +├── gov.ts # Governance module actions +├── ibc.ts # IBC module actions +├── insurance.ts # Insurance module actions +├── mint.ts # Mint module actions +├── mito.ts # Mito module actions +├── peggy.ts # Peggy module actions +├── permissions.ts # Permissions module actions +├── staking.ts # Staking module actions +├── token-factory.ts # Token Factory module actions +├── wasm.ts # WASM module actions +├── base.ts # Base action creation logic +└── index.ts # Main export file +``` + +## Module Organization + +Each module file follows a consistent organization pattern: + +### 1. File Structure +```typescript +// src/[module].ts + +import { createGenericAction } from './base'; +import * as ModuleTemplates from '@injective/template/[module]'; +import * as ModuleExamples from '@injective/examples/[module]'; + +// Export individual actions +export const Action1 = createGenericAction({...}); +export const Action2 = createGenericAction({...}); + +// Export all actions as a group +export const ModuleActions = [ + Action1, + Action2, + // ...other actions +]; +``` + +### 2. Main Export File +```typescript +// src/index.ts + +export * from './auction'; +export * from './auth'; +// ...other module exports + +export const InjectiveActions = [ + ...ExchangeActions, + ...AuctionActions, + // ...other module actions +]; +``` + +## Module Descriptions + +### auction.ts +Handles auction-related functionality including module parameters, auction rounds, and bidding. + +### auth.ts +Manages authentication, account details, and authorization grants. + +### bank.ts +Handles account balances, token transfers, and supply queries. + +### distribution.ts +Manages reward distribution and withdrawals. + +### exchange.ts +Core exchange functionality including spot/derivative markets, orders, and positions. + +### explorer.ts +Blockchain explorer functionality including transaction and block queries. + +### gov.ts +Handles protocol governance including proposals and voting. + +### ibc.ts +Inter-Blockchain Communication functionality. + +### insurance.ts +Manages insurance funds and redemptions. + +### mint.ts +Controls token minting and inflation parameters. + +### mito.ts +Handles Mito-specific functionality. + +### peggy.ts +Manages Ethereum bridge operations. + +### permissions.ts +Controls role-based access and permissions. + +### staking.ts +Manages validator operations and delegations. + +### token-factory.ts +Handles token creation and management. + +### wasm.ts +Smart contract functionality including deployment and execution. + +## Development + +### Adding New Actions + +1. Add action to appropriate module file: +```typescript +export const NewAction = createGenericAction({ + name: 'ACTION_NAME', + description: 'Action description', + template: Templates.template, + examples: Examples.example, + functionName: 'functionName', + validateContent: () => true +}); + +export const ModuleActions = [ + ...existingActions, + NewAction +]; +``` + +### Adding New Modules + +1. Create new module file: +```typescript +// src/new-module.ts +export const NewModuleActions = [...]; +``` + +2. Add to main exports: +```typescript +// src/index.ts +export * from './new-module'; +``` + +## Installation + +```bash +npm install @elizaos/plugin-injective +``` + +## Usage + +```typescript +import { InjectiveActions } from '@elizaos/plugin-injective'; +``` + +## Contributing +Feel free to contribute to more similes, examples and refined templates - for a more robust action contorl. + +1. Fork the repository +2. Create your feature branch +3. Commit your changes +4. Push to the branch +5. Create a Pull Request + +## License + +ISC \ No newline at end of file diff --git a/packages/plugin-injective/eslint.config.mjs b/packages/plugin-injective/eslint.config.mjs new file mode 100644 index 00000000000..92fe5bbebef --- /dev/null +++ b/packages/plugin-injective/eslint.config.mjs @@ -0,0 +1,3 @@ +import eslintGlobalConfig from "../../eslint.config.mjs"; + +export default [...eslintGlobalConfig]; diff --git a/packages/plugin-injective/injective-sdk-client-ts/.eslintignore b/packages/plugin-injective/injective-sdk-client-ts/.eslintignore new file mode 100644 index 00000000000..d93463d4d64 --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/.eslintignore @@ -0,0 +1,3 @@ +node_modules/ +dist/ +build/ diff --git a/packages/plugin-injective/injective-sdk-client-ts/.eslintrc.js b/packages/plugin-injective/injective-sdk-client-ts/.eslintrc.js new file mode 100644 index 00000000000..2688cb34e7a --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/.eslintrc.js @@ -0,0 +1,23 @@ +module.exports = { + "root": true, + "parser": "@typescript-eslint/parser", + "plugins": [ + "@typescript-eslint" + ], + "extends": [ + "eslint:recommended", + "plugin:@typescript-eslint/recommended" + ], + "rules": { + // TypeScript-specific rules + "@typescript-eslint/no-explicit-any": "warn", + "@typescript-eslint/explicit-function-return-type": "off", + "@typescript-eslint/no-unused-vars": ["warn", { "argsIgnorePattern": "^_" }], + + // General ESLint rules + "no-console": "warn", + "eqeqeq": "error", + "no-duplicate-imports": "error", + "prefer-const": "warn" + } +} \ No newline at end of file diff --git a/packages/plugin-injective/injective-sdk-client-ts/Readme.md b/packages/plugin-injective/injective-sdk-client-ts/Readme.md new file mode 100644 index 00000000000..e2a8c26f110 --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/Readme.md @@ -0,0 +1,190 @@ +# Injective SDK Client TypeScript + +A TypeScript client implementation for interacting with the Injective Protocol blockchain, providing comprehensive access to both chain and indexer gRPC endpoints. + +## Project Structure + +``` +plugin-injective/ +├── .vscode/ +├── injective-sdk-client-ts/ +│ ├── src/ +│ │ ├── exceptions/ +│ │ ├── grpc/ +│ │ │ ├── grpc-base.ts # Base gRPC client implementation +│ │ │ └── modules/ # Module-specific implementations +│ │ │ ├── auction.ts +│ │ │ ├── auth.ts +│ │ │ ├── authz.ts +│ │ │ ├── bank.ts +│ │ │ ├── distribution.ts +│ │ │ ├── exchange.ts +│ │ │ ├── explorer.ts +│ │ │ ├── gov.ts +│ │ │ ├── ibc.ts +│ │ │ ├── insurance-fund.ts +│ │ │ ├── mint.ts +│ │ │ ├── mito.ts +│ │ │ ├── oracle.ts +│ │ │ ├── peggy.ts +│ │ │ ├── permissions.ts +│ │ │ ├── staking.ts +│ │ │ ├── token-factory.ts +│ │ │ ├── wasm.ts +│ │ │ └── wasmx.ts +│ │ ├── template/ +│ │ └── types/ +│ ├── .eslintignore +│ ├── .eslintrc.js +│ ├── eslint.config.mjs +│ ├── package-lock.json +│ ├── package.json +│ └── tsconfig.json +``` + +## Features + +- **Comprehensive Module Support**: Includes implementations for all major Injective Protocol modules +- **Dual API Support**: Handles both Chain gRPC and Indexer gRPC endpoints +- **Type Safety**: Full TypeScript implementation with comprehensive type definitions +- **Error Handling**: Custom exception handling for gRPC-specific errors +- **Network Flexibility**: Supports multiple network types (Mainnet, Testnet, etc.) + +## Core Components + +### InjectiveGrpcBase + +The base class that provides fundamental gRPC functionality: +- Network configuration management +- Connection handling +- Request/query execution +- Message broadcasting capabilities + +### Supported Modules + +1. **Chain gRPC Modules** + - Auction + - Auth/AuthZ + - Bank + - Distribution + - Exchange + - Governance + - IBC + - Insurance Fund + - Mint + - Oracle + - Peggy + - Permissions + - Staking + - Token Factory + - Wasm/WasmX + +2. **Indexer gRPC Modules** + - Account & Portfolio + - Derivatives + - Spot Trading + - Explorer + - Insurance Fund + - Mito + - Oracle + - Web3 Gateway + +## Installation + +```bash +pnpm install +``` + +## Build and Use +To build and use the project, run the following command +```bash +pnpm build +``` + +## Usage + +Basic setup: + +```typescript +import { InjectiveGrpcClient } from '@injectivelabs/injective-sdk-client-ts' + +// Initialize client +const client = new InjectiveGrpcClient({ + networkType: "Mainnet", + privateKey: "your-private-key" +}) + +// Example: Query bank balance +const getBalance = async () => { + const response = await client.getBankBalance({ + address: "inj1..." + }) + console.log(response) +} +``` + +### Key Features + +1. **Address Generation** +```typescript +const address = getAddressFromPrivateKey(privateKey) +``` + +2. **Message Broadcasting** +```typescript +// Send tokens +const response = await client.msgSend({ + amount: "1000000000", + denom: "inj", + recipient: "inj1...", +}) +``` + +3. **Market Data Queries** +```typescript +// Get spot markets +const markets = await client.getSpotMarkets({}) + +// Get derivative markets +const derivativeMarkets = await client.getDerivativeMarkets({}) +``` + +## Error Handling + +The client implements custom error handling through the `GrpcException` class: + +```typescript +try { + await client.someMethod() +} catch (e) { + if (e instanceof GrpcException) { + console.error(`gRPC error: ${e.message}`) + } +} +``` + +## Network Configuration + +Supports multiple network types: +- Mainnet +- Testnet +- Devnet + +```typescript +const client = new InjectiveGrpcClient({ + networkType: "Testnet", + privateKey: "your-private-key" +}) +``` + +## Contributing + +1. Fork the repository +2. Create your feature branch (`git checkout -b feature/amazing-feature`) +3. Commit your changes (`git commit -m 'Add some amazing feature'`) +4. Push to the branch (`git push origin feature/amazing-feature`) +5. Open a Pull Request + +## License + +This project is licensed under the MIT License - see the LICENSE file for details. \ No newline at end of file diff --git a/packages/plugin-injective/injective-sdk-client-ts/eslint.config.mjs b/packages/plugin-injective/injective-sdk-client-ts/eslint.config.mjs new file mode 100644 index 00000000000..2415fb89f50 --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/eslint.config.mjs @@ -0,0 +1,37 @@ +import globals from "globals"; +import pluginJs from "@eslint/js"; +import tseslint from "typescript-eslint"; + +export default [ + { + files: ["**/*.{js,mjs,cjs,ts}"], + languageOptions: { + globals: { + ...globals.browser, + ...globals.node + }, + parserOptions: { + ecmaVersion: "latest", + sourceType: "module" + } + } + }, + pluginJs.configs.recommended, + ...tseslint.configs.recommended, + { + rules: { + // Customize rules as needed + "no-unused-vars": "warn", + "@typescript-eslint/no-explicit-any": "warn", + "no-console": "warn" + } + }, + { + ignores: [ + "node_modules/", + "dist/", + "build/", + "**/*.d.ts" + ] + } +]; \ No newline at end of file diff --git a/packages/plugin-injective/injective-sdk-client-ts/package.json b/packages/plugin-injective/injective-sdk-client-ts/package.json new file mode 100644 index 00000000000..88cc4794864 --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/package.json @@ -0,0 +1,50 @@ +{ + "name": "@injectivelabs/injective-sdk-client-ts", + "version": "1.0.0", + "description": "Injective Protocol TypeScript Library", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "scripts": { + "build": "tsc", + "test": "jest", + "lint": "eslint . ", + "lint:fix": "eslint . --fix", + "format": "prettier --write \"src/**/*.ts\"", + "test:integration": "vitest integration --reporter verbose", + "dev": "tsc --watch", + "type-check": "tsc --noEmit" + }, + "exports": { + ".": { + "require": "./dist/index.cjs", + "import": "./dist/index.js", + "types": "./dist/index.d.ts" + } + }, + + "dependencies": { + "@injectivelabs/networks": "1.14.34-beta.2", + "@injectivelabs/sdk-ts": "1.14.34-beta.2", + "@injectivelabs/token-metadata": "1.14.11", + "@injectivelabs/ts-types": "1.14.34-beta.2", + "@injectivelabs/utils": "1.14.34-beta.2", + "bignumber.js": "^9.1.2" + }, + "devDependencies": { + "@esbuild-plugins/node-globals-polyfill": "^0.2.3", + "@esbuild-plugins/node-modules-polyfill": "^0.2.2", + "@eslint/js": "^9.17.0", + "@types/eslint__js": "^8.42.3", + "@types/jest": "^29.5.14", + "@types/node": "^20.10.0", + "@typescript-eslint/eslint-plugin": "^6.21.0", + "@typescript-eslint/parser": "^6.21.0", + "eslint": "^8.57.1", + "eslint-config-prettier": "^9.1.0", + "globals": "^15.14.0", + "prettier": "^3.1.0", + "typescript": "^5.3.2", + "typescript-eslint": "^8.19.0", + "vitest": "latest" + } + } \ No newline at end of file diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/examples/auction.ts b/packages/plugin-injective/injective-sdk-client-ts/src/examples/auction.ts new file mode 100644 index 00000000000..d9da1b1959e --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/examples/auction.ts @@ -0,0 +1,218 @@ +export const getAuctionModuleParamsExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve the auction module parameters, including the auction period and the minimum next bid increment rate.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Auction module parameters retrieved successfully.", + action: "GET_AUCTION_MODULE_PARAMS", + content: { + auctionPeriod: 7200, + minNextBidIncrementRate: "0.05", + }, + }, + }, +]; + +export const getAuctionModuleStateExample = [ + { + user: "{{user1}}", + content: { + text: "Get the current state of the auction module, including parameters, auction round, highest bid, and auction ending timestamp.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Auction module state retrieved successfully.", + action: "GET_AUCTION_MODULE_STATE", + content: { + params: { + auctionPeriod: 7200, + minNextBidIncrementRate: "0.05", + }, + auctionRound: 12, + highestBid: { + bidder: "inj1xmpl3bidderaddress", + amount: "2500000000", + }, + auctionEndingTimestamp: 1700000000, + }, + }, + }, +]; + +export const getCurrentBasketExample = [ + { + user: "{{user1}}", + content: { + text: "Fetch the details of the current auction basket, including the list of amounts, auction round, closing time, highest bidder, and highest bid amount.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Current auction basket details retrieved successfully.", + action: "GET_CURRENT_BASKET", + content: { + amountList: [ + { + denom: "inj", + amount: "500000000", + }, + { + denom: "usdt", + amount: "1000000", + }, + ], + auctionRound: 12, + auctionClosingTime: 1700003600, + highestBidder: "inj1xmpl3bidderaddress", + highestBidAmount: "2500000000", + }, + }, + }, +]; + +export const getAuctionRoundExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve information for auction round number 12.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Auction round 12 details retrieved successfully.", + action: "GET_AUCTION_ROUND", + content: { + auction: { + winner: "inj1w1nn3raddress", + basketList: [ + { + denom: "inj", + amount: "500000000", + }, + { + denom: "usdt", + amount: "1000000", + }, + ], + winningBidAmount: "2500000000", + round: 12, + endTimestamp: 1700000000, + updatedAt: 1700000000, + }, + bids: [ + { + bidder: "inj1bidder1address", + bidAmount: "2000000000", + bidTimestamp: 1699999000, + }, + { + bidder: "inj1bidder2address", + bidAmount: "2500000000", + bidTimestamp: 1699999500, + }, + ], + }, + }, + }, +]; + +export const getAuctionsExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve the list of all past auctions with their details.", + }, + }, + { + user: "{{agent}}", + content: { + text: "List of auctions retrieved successfully.", + action: "GET_AUCTIONS", + content: [ + { + winner: "inj1w1nn3raddress", + basketList: [ + { + denom: "inj", + amount: "500000000", + }, + { + denom: "usdt", + amount: "1000000", + }, + ], + winningBidAmount: "2500000000", + round: 12, + endTimestamp: 1700000000, + updatedAt: 1700000000, + }, + { + winner: "inj1w1nn3raddress2", + basketList: [ + { + denom: "inj", + amount: "750000000", + }, + { + denom: "usdt", + amount: "1500000", + }, + ], + winningBidAmount: "3500000000", + round: 11, + endTimestamp: 1699996400, + updatedAt: 1699996400, + }, + ], + }, + }, +]; + +export const msgBidExample = [ + { + user: "{{user1}}", + content: { + text: "Place a bid of 2600000000 INJ_DENOM in auction round 12.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Bid placed successfully.", + action: "PLACE_BID", + content: { + round: 12, + amount: "2600000000", + }, + }, + }, +]; + +export const msgBidResponseExample = [ + { + user: "{{user1}}", + content: { + text: "Confirm the bid transaction.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Bid transaction processed.", + action: "BID_TRANSACTION_RESPONSE", + content: { + txHash: "0xabc123def456ghi789jkl012mno345pqr678stu901vwx234yz", + success: true, + }, + }, + }, +]; diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/examples/auth.ts b/packages/plugin-injective/injective-sdk-client-ts/src/examples/auth.ts new file mode 100644 index 00000000000..23ae93c9779 --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/examples/auth.ts @@ -0,0 +1,313 @@ +export const getAuthModuleParamsExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve the auth module parameters, including max memo characters, transaction signature limit, transaction size cost per byte, and signature verification costs.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Auth module parameters retrieved successfully.", + action: "GET_AUTH_MODULE_PARAMS", + content: { + maxMemoCharacters: 256, + txSigLimit: 7, + txSizeCostPerByte: 10, + sigVerifyCostEd25519: 590, + sigVerifyCostSecp256k1: 1000, + }, + }, + }, +]; + +export const getAccountDetailsExample = [ + { + user: "{{user1}}", + content: { + text: "Fetch the account details for address inj1exampleaddress.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Account details retrieved successfully.", + action: "GET_ACCOUNT_DETAILS", + content: { + codeHash: "0xabcdef1234567890", + baseAccount: { + address: "inj1exampleaddress", + pubKey: { + key: "A1B2C3D4E5F6G7H8I9J0", + typeUrl: "/cosmos.crypto.secp256k1.PubKey", + }, + accountNumber: 123456, + sequence: 789012, + }, + }, + }, + }, +]; + +export const getAccountsExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve the list of all accounts with pagination.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Accounts list retrieved successfully.", + action: "GET_ACCOUNTS", + content: { + pagination: { + nextKey: "eyJwYWdlIjoyfQ==", + total: 250, + }, + accounts: [ + { + codeHash: "0xabcdef1234567890", + baseAccount: { + address: "inj1account1address", + pubKey: { + key: "Z9Y8X7W6V5U4T3S2R1Q", + typeUrl: "/cosmos.crypto.secp256k1.PubKey", + }, + accountNumber: 654321, + sequence: 210987, + }, + }, + { + codeHash: "0x1234567890abcdef", + baseAccount: { + address: "inj1account2address", + pubKey: { + key: "L1K2J3H4G5F6D7S8A9Q", + typeUrl: "/cosmos.crypto.secp256k1.PubKey", + }, + accountNumber: 112233, + sequence: 445566, + }, + }, + ], + }, + }, + }, +]; + +export const getGrantsExample = [ + { + user: "{{user1}}", + content: { + text: "Fetch all grants for granter inj1granteraddress and grantee inj1granteeaddress with message type /cosmos.bank.v1beta1.MsgSend.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Grants fetched successfully.", + action: "GET_GRANTS", + content: { + pagination: { + nextKey: "eyJwYWdlIjozfQ==", + total: 15, + }, + grants: [ + { + authorization: { + "@type": + "/cosmos.authz.v1beta1.GenericAuthorization", + msg: "/cosmos.bank.v1beta1.MsgSend", + }, + authorizationType: "GenericAuthorization", + expiration: "2024-12-31T23:59:59Z", + }, + { + authorization: { + "@type": "/cosmos.authz.v1beta1.SendAuthorization", + spendLimit: [ + { + denom: "inj", + amount: "1000000", + }, + ], + }, + authorizationType: "SendAuthorization", + expiration: "2025-06-30T12:00:00Z", + }, + ], + }, + }, + }, +]; + +export const getGranterGrantsExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve all grants made by granter inj1granteraddress with pagination.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Granter's grants fetched successfully.", + action: "GET_GRANTER_GRANTS", + content: { + pagination: { + nextKey: "eyJwYWdlIjozfQ==", + total: 10, + }, + grants: [ + { + granter: "inj1granteraddress", + grantee: "inj1grantee1address", + authorization: { + "@type": + "/cosmos.authz.v1beta1.GenericAuthorization", + msg: "/cosmos.bank.v1beta1.MsgSend", + }, + authorizationType: "GenericAuthorization", + expiration: "2024-12-31T23:59:59Z", + }, + { + granter: "inj1granteraddress", + grantee: "inj1grantee2address", + authorization: { + "@type": "/cosmos.authz.v1beta1.SendAuthorization", + spendLimit: [ + { + denom: "usdt", + amount: "500000", + }, + ], + }, + authorizationType: "SendAuthorization", + expiration: "2025-01-15T08:30:00Z", + }, + ], + }, + }, + }, +]; + +export const getGranteeGrantsExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve all grants received by grantee inj1granteeaddress with pagination.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Grantee's grants fetched successfully.", + action: "GET_GRANTEE_GRANTS", + content: { + pagination: { + nextKey: "eyJwYWdlIjozfQ==", + total: 8, + }, + grants: [ + { + granter: "inj1granter1address", + grantee: "inj1granteeaddress", + authorization: { + "@type": + "/cosmos.authz.v1beta1.GenericAuthorization", + msg: "/cosmos.bank.v1beta1.MsgSend", + }, + authorizationType: "GenericAuthorization", + expiration: "2024-12-31T23:59:59Z", + }, + { + granter: "inj1granter2address", + grantee: "inj1granteeaddress", + authorization: { + "@type": "/cosmos.authz.v1beta1.SendAuthorization", + spendLimit: [ + { + denom: "inj", + amount: "250000", + }, + ], + }, + authorizationType: "SendAuthorization", + expiration: "2025-03-10T16:45:00Z", + }, + ], + }, + }, + }, +]; + +export const msgGrantExample = [ + { + user: "{{user1}}", + content: { + text: "Grant authorization to grantee inj1granteeaddress for message type /cosmos.bank.v1beta1.MsgSend.", + }, + }, +]; + +export const msgGrantResponseExample = [ + { + user: "{{agent}}", + content: { + text: "Authorization granted successfully.", + action: "MSG_GRANT", + content: { + txHash: "0xgrant123hash456def789ghi012jkl345mno678pqr901stu234vwx", + success: true, + }, + }, + }, +]; + +export const msgExecExample = [ + { + user: "{{user1}}", + content: { + text: "Execute authorized messages for grantee inj1granteeaddress: Send 1000000000 inj to inj1recipientaddress.", + }, + }, +]; + +export const msgExecResponseExample = [ + { + user: "{{agent}}", + content: { + text: "Authorized messages executed successfully.", + action: "MSG_EXEC", + content: { + txHash: "0xexec123hash456def789ghi012jkl345mno678pqr901stu234vwx", + success: true, + }, + }, + }, +]; + +export const msgRevokeExample = [ + { + user: "{{user1}}", + content: { + text: "Revoke authorization for grantee inj1granteeaddress for message type /cosmos.bank.v1beta1.MsgSend.", + }, + }, +]; + +export const msgRevokeResponseExample = [ + { + user: "{{agent}}", + content: { + text: "Authorization revoked successfully.", + action: "MSG_REVOKE", + content: { + txHash: "0xrevoke123hash456def789ghi012jkl345mno678pqr901stu234vwx", + success: true, + }, + }, + }, +]; diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/examples/bank.ts b/packages/plugin-injective/injective-sdk-client-ts/src/examples/bank.ts new file mode 100644 index 00000000000..794ff2409ba --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/examples/bank.ts @@ -0,0 +1,412 @@ +export const getBankModuleParamsExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve the bank module parameters, including send enabled list and default send enabled status.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Bank module parameters retrieved successfully.", + action: "GET_BANK_MODULE_PARAMS", + content: { + sendEnabledList: [ + { + denom: "inj", + enabled: true, + }, + { + denom: "usdt", + enabled: false, + }, + ], + defaultSendEnabled: true, + }, + }, + }, +]; + +export const getBankBalanceExample = [ + { + user: "{{user1}}", + content: { + text: "Fetch the bank balance for account inj1exampleaddress and denomination inj.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Bank balance retrieved successfully.", + action: "GET_BANK_BALANCE", + content: { + denom: "inj", + amount: "1000000000", + }, + }, + }, +]; + +export const getBankBalancesExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve all bank balances for account inj1exampleaddress with pagination.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Bank balances retrieved successfully.", + action: "GET_BANK_BALANCES", + content: { + balances: [ + { + denom: "inj", + amount: "1000000000", + }, + { + denom: "usdt", + amount: "5000000", + }, + ], + pagination: { + nextKey: "eyJwYWdlIjozfQ==", + total: 2, + }, + }, + }, + }, +]; + +export const getTotalSupplyExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve the total supply with optional pagination.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Total supply retrieved successfully.", + action: "GET_TOTAL_SUPPLY", + content: { + supply: [ + { + denom: "inj", + amount: "1000000000000", + }, + { + denom: "usdt", + amount: "2000000000", + }, + ], + pagination: { + nextKey: "eyJwYWdlIjozfQ==", + total: 2, + }, + }, + }, + }, +]; + +export const getAllTotalSupplyExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve the complete total supply for all denominations.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Complete total supply retrieved successfully.", + action: "GET_ALL_TOTAL_SUPPLY", + content: { + supply: [ + { + denom: "inj", + amount: "1000000000000", + }, + { + denom: "usdt", + amount: "2000000000", + }, + { + denom: "btc", + amount: "500000000", + }, + ], + pagination: { + nextKey: null, + total: 3, + }, + }, + }, + }, +]; + +export const getSupplyOfExample = [ + { + user: "{{user1}}", + content: { + text: "Get the supply of denomination inj.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Supply of inj retrieved successfully.", + action: "GET_SUPPLY_OF", + content: { + denom: "inj", + amount: "1000000000000", + }, + }, + }, +]; + +export const getDenomsMetadataExample = [ + { + user: "{{user1}}", + content: { + text: "Fetch metadata for all denominations with pagination.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Denomination metadata fetched successfully.", + action: "GET_DENOMS_METADATA", + content: { + metadatas: [ + { + description: + "The native staking token of the Injective blockchain", + denom_units: [ + { + denom: "inj", + exponent: 0, + aliases: ["inj"], + }, + ], + base: "inj", + display: "inj", + name: "Injective", + symbol: "INJ", + }, + { + description: "USD Tether", + denom_units: [ + { + denom: "usdt", + exponent: 0, + aliases: ["usdt"], + }, + ], + base: "usdt", + display: "usdt", + name: "Tether USD", + symbol: "USDT", + }, + ], + pagination: { + nextKey: "eyJwYWdlIjozfQ==", + total: 2, + }, + }, + }, + }, +]; + +export const getDenomMetadataExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve metadata for denomination inj.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Denomination metadata for inj retrieved successfully.", + action: "GET_DENOM_METADATA", + content: { + description: + "The native staking token of the Injective blockchain", + denom_units: [ + { + denom: "inj", + exponent: 0, + aliases: ["inj"], + }, + { + denom: "inj", + exponent: 6, + aliases: ["uinj"], + }, + ], + base: "inj", + display: "inj", + name: "Injective", + symbol: "INJ", + }, + }, + }, +]; + +export const getDenomOwnersExample = [ + { + user: "{{user1}}", + content: { + text: "Get the owners of denomination inj with pagination.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Denomination owners retrieved successfully.", + action: "GET_DENOM_OWNERS", + content: { + denomOwners: [ + { + address: "inj1address1", + balance: { + denom: "inj", + amount: "500000000", + }, + }, + { + address: "inj1address2", + balance: { + denom: "inj", + amount: "300000000", + }, + }, + ], + pagination: { + nextKey: "eyJwYWdlIjozfQ==", + total: 2, + }, + }, + }, + }, +]; + +export const msgSendExample = [ + { + user: "{{user1}}", + content: { + text: "Send 1000000000 inj from inj1senderaddress to inj1recipientaddress.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Send transaction submitted successfully.", + action: "MSG_SEND", + content: { + srcInjectiveAddress: "inj1senderaddress", + dstInjectiveAddress: "inj1recipientaddress", + amount: { + denom: "inj", + amount: "1000000000", + }, + }, + }, + }, +]; + +export const msgSendResponseExample = [ + { + user: "{{user1}}", + content: { + text: "Confirm the send transaction.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Send transaction processed successfully.", + action: "MSG_SEND_RESPONSE", + content: { + txHash: "0xsendinghash123def456ghi789jkl012mno345pqr678stu901vwx234yz", + success: true, + }, + }, + }, +]; + +export const msgMultiSendExample = [ + { + user: "{{user1}}", + content: { + text: "Execute a multi-send transaction: send 500000000 inj and 2500000 usdt from inj1senderaddress to inj1recipient1address and inj1recipient2address.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Multi-send transaction submitted successfully.", + action: "MSG_MULTI_SEND", + content: { + inputs: [ + { + address: "inj1senderaddress", + coins: [ + { + denom: "inj", + amount: "500000000", + }, + { + denom: "usdt", + amount: "2500000", + }, + ], + }, + ], + outputs: [ + { + address: "inj1recipient1address", + coins: [ + { + denom: "inj", + amount: "300000000", + }, + ], + }, + { + address: "inj1recipient2address", + coins: [ + { + denom: "inj", + amount: "200000000", + }, + ], + }, + ], + }, + }, + }, +]; + +export const msgMultiSendResponseExample = [ + { + user: "{{user1}}", + content: { + text: "Confirm the multi-send transaction.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Multi-send transaction processed successfully.", + action: "MSG_MULTI_SEND_RESPONSE", + content: { + txHash: "0xmultisendhash123def456ghi789jkl012mno345pqr678stu901vwx234yz", + success: true, + }, + }, + }, +]; diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/examples/distribution.ts b/packages/plugin-injective/injective-sdk-client-ts/src/examples/distribution.ts new file mode 100644 index 00000000000..25c01fe9ef0 --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/examples/distribution.ts @@ -0,0 +1,222 @@ +export const getDistributionModuleParamsExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve the distribution module parameters, including community tax, base proposer reward, bonus proposer reward, and withdraw address enabled status.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Distribution module parameters retrieved successfully.", + action: "GET_DISTRIBUTION_MODULE_PARAMS", + content: { + communityTax: "0.020000000000000000", + baseProposerReward: "0.010000000000000000", + bonusProposerReward: "0.040000000000000000", + withdrawAddrEnabled: true, + }, + }, + }, +]; + +export const getDelegatorRewardsForValidatorExample = [ + { + user: "{{user1}}", + content: { + text: "Get delegator rewards for delegator address inj1delegatoraddress and validator address injvaloper1validatoraddress.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Delegator rewards retrieved successfully.", + action: "GET_DELEGATOR_REWARDS_FOR_VALIDATOR", + content: [ + { + denom: "inj", + amount: "1000000000", + }, + ], + }, + }, +]; + +export const getDelegatorRewardsForValidatorNoThrowExample = [ + { + user: "{{user1}}", + content: { + text: "Get delegator rewards for delegator address inj1delegatoraddress and validator address injvaloper1validatoraddress without throwing errors.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Delegator rewards retrieved successfully (no-throw).", + action: "GET_DELEGATOR_REWARDS_FOR_VALIDATOR_NO_THROW", + content: [ + { + denom: "inj", + amount: "1000000000", + }, + ], + }, + }, +]; + +export const getDelegatorRewardsExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve all delegator rewards for delegator address inj1delegatoraddress.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Delegator rewards retrieved successfully.", + action: "GET_DELEGATOR_REWARDS", + content: [ + { + validatorAddress: "injvaloper1validatoraddress1", + rewards: [ + { + denom: "inj", + amount: "500000000", + }, + ], + }, + { + validatorAddress: "injvaloper1validatoraddress2", + rewards: [ + { + denom: "inj", + amount: "500000000", + }, + ], + }, + ], + }, + }, +]; + +export const getDelegatorRewardsNoThrowExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve all delegator rewards for delegator address inj1delegatoraddress without throwing errors.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Delegator rewards retrieved successfully (no-throw).", + action: "GET_DELEGATOR_REWARDS_NO_THROW", + content: [ + { + validatorAddress: "injvaloper1validatoraddress1", + rewards: [ + { + denom: "inj", + amount: "500000000", + }, + ], + }, + { + validatorAddress: "injvaloper1validatoraddress2", + rewards: [ + { + denom: "inj", + amount: "500000000", + }, + ], + }, + ], + }, + }, +]; + +export const msgWithdrawDelegatorRewardExample = [ + { + user: "{{user1}}", + content: { + text: "Withdraw delegator rewards for delegator address inj1delegatoraddress and validator address injvaloper1validatoraddress.", + }, + }, +]; + +export const msgWithdrawDelegatorRewardResponseExample = [ + { + user: "{{agent}}", + content: { + text: "Delegator rewards withdrawal submitted successfully.", + action: "MSG_WITHDRAW_DELEGATOR_REWARD", + content: { + delegatorAddress: "inj1delegatoraddress", + validatorAddress: "injvaloper1validatoraddress", + }, + }, + }, +]; + +export const msgWithdrawDelegatorRewardTransactionResponseExample = [ + { + user: "{{user1}}", + content: { + text: "Confirm the withdraw delegator reward transaction.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Withdraw delegator reward transaction processed successfully.", + action: "MSG_WITHDRAW_DELEGATOR_REWARD_RESPONSE", + content: { + txHash: "0xwithdrawdelegatorrewardhash123def456ghi789jkl012mno345pqr678stu901vwx234yz", + success: true, + }, + }, + }, +]; + +export const msgWithdrawValidatorCommissionExample = [ + { + user: "{{user1}}", + content: { + text: "Withdraw validator commission for validator address injvaloper1validatoraddress.", + }, + }, +]; + +export const msgWithdrawValidatorCommissionResponseExample = [ + { + user: "{{agent}}", + content: { + text: "Validator commission withdrawal submitted successfully.", + action: "MSG_WITHDRAW_VALIDATOR_COMMISSION", + content: { + validatorAddress: "injvaloper1validatoraddress", + }, + }, + }, +]; + +export const msgWithdrawValidatorCommissionTransactionResponseExample = [ + { + user: "{{user1}}", + content: { + text: "Confirm the withdraw validator commission transaction.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Withdraw validator commission transaction processed successfully.", + action: "MSG_WITHDRAW_VALIDATOR_COMMISSION_RESPONSE", + content: { + txHash: "0xwithdrawvalidatorcommissionhash123def456ghi789jkl012mno345pqr678stu901vwx234yz", + success: true, + }, + }, + }, +]; diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/examples/exchange.ts b/packages/plugin-injective/injective-sdk-client-ts/src/examples/exchange.ts new file mode 100644 index 00000000000..3bbe96297bd --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/examples/exchange.ts @@ -0,0 +1,2304 @@ +export const getAccountPortfolioExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve account portfolio for address 'inj1...'.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Account portfolio retrieved successfully.", + action: "GET_ACCOUNT_PORTFOLIO", + content: { + accountAddress: "inj1...", + bankBalancesList: [ + { + amount: "1000000", + denom: "inj", + }, + ], + subaccountsList: [ + { + subaccountId: "subaccount_id", + denom: "inj", + deposit: { + totalBalance: "1000000", + availableBalance: "900000", + }, + }, + ], + positionsWithUpnlList: [ + { + position: { + marketId: "market_id", + subaccountId: "subaccount_id", + direction: "long", + quantity: "1.5", + entryPrice: "25000.5", + margin: "1000", + liquidationPrice: "24000.0", + markPrice: "25100.0", + ticker: "BTC/USDT", + }, + unrealizedPnl: "150.75", + }, + ], + }, + }, + }, +]; + +export const getSubaccountHistoryExample = [ + { + user: "{{user1}}", + content: { + text: "Fetch subaccount history for subaccount ID 'subaccount_id' with denom 'inj' and transfer types ['deposit', 'withdraw'].", + }, + }, + { + user: "{{agent}}", + content: { + text: "Subaccount history retrieved successfully.", + action: "GET_SUBACCOUNT_HISTORY", + content: { + transfers: [ + { + transferType: "deposit", + srcSubaccountId: "src_subaccount_id", + srcSubaccountAddress: "inj1...", + dstSubaccountId: "dst_subaccount_id", + dstSubaccountAddress: "inj1...", + amount: { + amount: "1000000", + denom: "inj", + }, + executedAt: 1641859200, + }, + ], + pagination: { + total: 100, + }, + }, + }, + }, +]; + +export const getSpotMarketExample = [ + { + user: "{{user1}}", + content: { + text: "Lookup spot market with market ID 'market_id'.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Spot market retrieved successfully.", + action: "GET_SPOT_MARKET", + content: { + marketId: "market_id", + marketStatus: "active", + ticker: "INJ/USDT", + baseDenom: "inj", + quoteDenom: "usdt", + makerFeeRate: "0.001", + takerFeeRate: "0.002", + serviceProviderFee: "0.4", + minPriceTickSize: 0.000001, + minQuantityTickSize: 0.000001, + }, + }, + }, +]; + +export const getDerivativeMarketExample = [ + { + user: "{{user1}}", + content: { + text: "Lookup derivative market with market ID 'market_id'.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Derivative market retrieved successfully.", + action: "GET_DERIVATIVE_MARKET", + content: { + marketId: "market_id", + marketStatus: "active", + ticker: "BTC/USDT PERP", + oracleBase: "BTC", + oracleQuote: "USDT", + quoteDenom: "usdt", + makerFeeRate: "0.001", + takerFeeRate: "0.002", + serviceProviderFee: "0.4", + initialMarginRatio: "0.05", + maintenanceMarginRatio: "0.02", + isPerpetual: true, + minPriceTickSize: 0.01, + minQuantityTickSize: 0.001, + }, + }, + }, +]; + +export const getExchangePositionsExample = [ + { + user: "{{user1}}", + content: { + text: "Query positions of the exchange modules", + }, + }, + { + user: "{{agent}}", + content: { + text: "Positions retrieved successfully.", + action: "GET_EXCHANGE_POSITIONS", + content: { + positions: [ + { + marketId: "market_id", + subaccountId: "subaccount_id", + direction: "long", + quantity: "1.5", + entryPrice: "25000.5", + margin: "1000", + liquidationPrice: "24000.0", + markPrice: "25100.0", + ticker: "BTC/USDT", + }, + ], + pagination: { + total: 100, + }, + }, + }, + }, +]; + +export const getInsuranceFundsExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve insurance funds information.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Insurance funds information retrieved successfully.", + action: "GET_INSURANCE_FUNDS", + content: { + funds: [ + { + depositDenom: "inj", + insurancePoolTokenDenom: "insurance_pool_token", + redemptionNoticePeriodDuration: 1209600, + balance: "1000000", + totalShare: "1000000", + marketId: "market_id", + marketTicker: "BTC/USDT PERP", + oracleBase: "BTC", + oracleQuote: "USDT", + oracleType: "band", + expiry: 0, + }, + ], + }, + }, + }, +]; + +export const getRedemptionsExample = [ + { + user: "{{user1}}", + content: { + text: "Query redemptions for address 'inj1...' with denom 'inj' and status 'pending'.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Redemptions retrieved successfully.", + action: "GET_REDEMPTIONS", + content: { + redemptions: [ + { + redemptionId: 1, + status: "pending", + redeemer: "inj1...", + claimableRedemptionTime: 1641859200, + redemptionAmount: "1000000", + redemptionDenom: "inj", + requestedAt: 1641772800, + disbursedAmount: "0", + disbursedDenom: "", + disbursedAt: 0, + }, + ], + }, + }, + }, +]; + +export const getSpotOrdersExample = [ + { + user: "{{user1}}", + content: { + text: "Query spot orders for market ID 'market_id1', 'market_id2', subaccount ID 'subaccount_id', order side 'buy', non-conditional, with pagination from 1 to 100 and limit 10.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Spot orders retrieved successfully.", + action: "GET_SPOT_ORDERS", + content: { + orders: [ + { + orderHash: "0x...", + orderSide: "buy", + marketId: "market_id", + subaccountId: "subaccount_id", + price: "25000.5", + quantity: "1.5", + unfilledQuantity: "0.5", + triggerPrice: "0", + feeRecipient: "inj1...", + state: "booked", + createdAt: 1641859200, + updatedAt: 1641859200, + }, + ], + pagination: { + total: 100, + }, + }, + }, + }, +]; + +export const getDerivativeOrdersExample = [ + { + user: "{{user1}}", + content: { + text: "Query derivative orders for market IDs 'market_id1' and 'market_id2', subaccount ID 'subaccount_id', order side 'buy', non-conditional, with pagination from 1 to 100 and limit 10.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Derivative orders retrieved successfully.", + action: "GET_DERIVATIVE_ORDERS", + content: { + orders: [ + { + orderHash: "0x...", + orderSide: "buy", + marketId: "market_id", + subaccountId: "subaccount_id", + margin: "1000", + price: "25000.5", + quantity: "1.5", + unfilledQuantity: "0.5", + triggerPrice: "0", + feeRecipient: "inj1...", + state: "booked", + createdAt: 1641859200, + updatedAt: 1641859200, + }, + ], + pagination: { + total: 100, + }, + }, + }, + }, +]; + +export const getHistoricalTradesExample = [ + { + user: "{{user1}}", + content: { + text: "Fetch historical trades for market IDs 'market_id1' and 'market_id2', subaccount ID 'subaccount_id', between start time 1641859200 and end time 1641945600, direction 'buy', with pagination from 1 to 100 and limit 10.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Historical trades retrieved successfully.", + action: "GET_HISTORICAL_TRADES", + content: { + trades: [ + { + orderHash: "0x...", + subaccountId: "subaccount_id", + marketId: "market_id", + tradeId: "trade_id", + executedAt: 1641859200, + tradeExecutionType: "limit", + tradeDirection: "buy", + executionPrice: "25000.5", + executionQuantity: "1.5", + fee: "0.5", + feeRecipient: "inj1...", + }, + ], + pagination: { + total: 100, + }, + }, + }, + }, +]; + +export const getFundingRatesExample = [ + { + user: "{{user1}}", + content: { + text: "Fetch funding rates for market ID 'market_id' with pagination from 1 to 100 and limit 10.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Funding rates retrieved successfully.", + action: "GET_FUNDING_RATES", + content: { + fundingRates: [ + { + marketId: "market_id", + rate: "0.0001", + timestamp: 1641859200, + }, + ], + pagination: { + total: 100, + }, + }, + }, + }, +]; + +export const msgDepositExample = [ + { + user: "{{user1}}", + content: { + text: "Deposit 1,000,000 INJ to subaccount '0x...' from address 'inj1...'.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Deposit successful.", + action: "MSG_DEPOSIT", + content: { + success: true, + txHash: "0x...", + }, + }, + }, +]; + +export const msgWithdrawExample = [ + { + user: "{{user1}}", + content: { + text: "Withdraw 1,000,000 INJ from subaccount '0x...' to address 'inj1...'.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Withdrawal successful.", + action: "MSG_WITHDRAW", + content: { + success: true, + txHash: "0x...", + }, + }, + }, +]; + +export const msgCreateSpotMarketOrderExample = [ + { + user: "{{user1}}", + content: { + text: "Create a spot market order to BUY 0.5 INJ at price 25000.5 for subaccount '0x...'.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Spot market order created successfully.", + action: "MSG_CREATE_SPOT_MARKET_ORDER", + content: { + orderHash: "0x...", + txHash: "0x...", + }, + }, + }, +]; + +export const msgCreateDerivativeMarketOrderExample = [ + { + user: "{{user1}}", + content: { + text: "Create a derivative market order to BUY 1.5 BTC/USDT PERP at price 25000.5 with margin 1000 for subaccount '0x...'.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Derivative market order created successfully.", + action: "MSG_CREATE_DERIVATIVE_MARKET_ORDER", + content: { + orderHash: "0x...", + txHash: "0x...", + }, + }, + }, +]; + +export const msgBatchCancelOrdersExample = [ + { + user: "{{user1}}", + content: { + text: "Batch cancel spot and derivative orders for subaccount '0x...' with order hashes ['0x...'].", + }, + }, + { + user: "{{agent}}", + content: { + text: "Batch orders canceled successfully.", + action: "MSG_BATCH_CANCEL_ORDERS", + content: { + success: true, + txHash: "0x...", + }, + }, + }, +]; + +export const msgBatchUpdateOrdersExample = [ + { + user: "{{user1}}", + content: { + text: "Batch update spot and derivative orders for subaccount '0x...' with updated prices and quantities.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Batch orders updated successfully.", + action: "MSG_BATCH_UPDATE_ORDERS", + content: { + spotOrderHashes: ["0x..."], + derivativeOrderHashes: ["0x..."], + txHash: "0x...", + }, + }, + }, +]; + +export const msgAdminUpdateBinaryOptionsMarketExample = [ + { + user: "{{user1}}", + content: { + text: "Admin 'inj1...' updates binary options market '0x...' with settlement price 25000.5, expiry time 1641859200, and settlement time 1641945600.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Binary options market updated successfully.", + action: "MSG_ADMIN_UPDATE_BINARY_OPTIONS_MARKET", + content: { + success: true, + txHash: "0x...", + }, + }, + }, +]; + +export const getModuleStateExample = [ + { + user: "{{user1}}", + content: { + text: "Fetch the current state of the exchange module.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Exchange module state retrieved successfully.", + action: "GET_MODULE_STATE", + content: { + moduleState: { + params: { + spotMarketInstantListingFee: { + amount: "100000000", + denom: "inj", + }, + derivativeMarketInstantListingFee: { + amount: "1000000000", + denom: "inj", + }, + defaultSpotMakerFeeRate: "0.001", + defaultSpotTakerFeeRate: "0.002", + defaultDerivativeMakerFeeRate: "0.001", + defaultDerivativeTakerFeeRate: "0.002", + defaultInitialMarginRatio: "0.05", + defaultMaintenanceMarginRatio: "0.02", + defaultFundingInterval: 3600, + fundingMultiple: 3600, + }, + spotMarkets: [], + derivativeMarkets: [], + spotOrderbooks: [], + derivativeOrderbooks: [], + balances: [], + positions: [], + }, + }, + }, + }, +]; + +export const getFeeDiscountScheduleExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve the fee discount schedule.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Fee discount schedule retrieved successfully.", + action: "GET_FEE_DISCOUNT_SCHEDULE", + content: { + bucketCount: 10, + bucketDuration: 1209600, + quoteDenomsList: ["inj"], + tierInfosList: [ + { + makerDiscountRate: "0.001", + takerDiscountRate: "0.001", + stakedAmount: "10000000000", + volume: "100000000", + }, + ], + disqualifiedMarketIdsList: [], + }, + }, + }, +]; + +export const getFeeDiscountAccountInfoExample = [ + { + user: "{{user1}}", + content: { + text: "Get fee discount account info for address 'inj1...'.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Fee discount account info retrieved successfully.", + action: "GET_FEE_DISCOUNT_ACCOUNT_INFO", + content: { + tierLevel: 1, + accountInfo: { + makerDiscountRate: "0.001", + takerDiscountRate: "0.001", + stakedAmount: "10000000000", + volume: "100000000", + }, + accountTtl: { + tier: 1, + ttlTimestamp: 1641945600, + }, + }, + }, + }, +]; + +export const getModuleParamsExample = [ + { + user: "{{user1}}", + content: { + text: "Fetch module parameters information.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Module parameters retrieved successfully.", + action: "GET_MODULE_PARAMS", + content: { + spotMarketInstantListingFee: { + amount: "100000000", + denom: "inj", + }, + derivativeMarketInstantListingFee: { + amount: "1000000000", + denom: "inj", + }, + defaultSpotMakerFeeRate: "0.001", + defaultSpotTakerFeeRate: "0.002", + defaultDerivativeMakerFeeRate: "0.001", + defaultDerivativeTakerFeeRate: "0.002", + defaultInitialMarginRatio: "0.05", + defaultMaintenanceMarginRatio: "0.02", + defaultFundingInterval: 3600, + fundingMultiple: 3600, + relayerFeeShareRate: "0.4", + exchangeModuleAdmin: "inj1...", + }, + }, + }, +]; + +export const getTradingRewardsCampaignExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve current trading rewards campaign information.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Trading rewards campaign information retrieved successfully.", + action: "GET_TRADING_REWARDS_CAMPAIGN", + content: { + tradingRewardCampaignInfo: { + campaignDurationSeconds: 604800, + quoteDenomsList: ["inj"], + tradingRewardBoostInfo: { + boostedSpotMarketIdsList: [], + spotMarketMultipliersList: [], + boostedDerivativeMarketIdsList: [], + derivativeMarketMultipliersList: [], + }, + disqualifiedMarketIdsList: [], + }, + tradingRewardPoolCampaignScheduleList: [ + { + startTimestamp: 1641859200, + maxCampaignRewardsList: [ + { + amount: "1000000000", + denom: "inj", + }, + ], + }, + ], + totalTradeRewardPoints: "1000000", + pendingTradingRewardPoolCampaignScheduleList: [], + pendingTotalTradeRewardPointsList: [], + }, + }, + }, +]; + +export const getTradeRewardPointsExample = [ + { + user: "{{user1}}", + content: { + text: "Get trade reward points for addresses ['inj1...', 'inj2...'].", + }, + }, + { + user: "{{agent}}", + content: { + text: "Trade reward points retrieved successfully.", + action: "GET_TRADE_REWARD_POINTS", + content: { + rewardPoints: ["100", "200"], + }, + }, + }, +]; + +export const getPendingTradeRewardPointsExample = [ + { + user: "{{user1}}", + content: { + text: "Get pending trade reward points for addresses ['inj1...', 'inj2...'].", + }, + }, + { + user: "{{agent}}", + content: { + text: "Pending trade reward points retrieved successfully.", + action: "GET_PENDING_TRADE_REWARD_POINTS", + content: { + rewardPoints: ["100", "200"], + }, + }, + }, +]; + +export const getBinaryOptionsMarketsExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve all active binary options markets with quote denom 'usdt'.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Binary options markets retrieved successfully.", + action: "GET_BINARY_OPTIONS_MARKETS", + content: { + markets: [ + { + marketId: "0x...", + marketStatus: "active", + ticker: "BTC>25000-240630", + oracleSymbol: "BTC", + oracleProvider: "band", + oracleScaleFactor: 6, + quoteDenom: "usdt", + makerFeeRate: "0.001", + takerFeeRate: "0.002", + expirationTimestamp: 1719705600, + settlementTimestamp: 1719792000, + serviceProviderFee: "0.4", + minPriceTickSize: 0.01, + minQuantityTickSize: 0.001, + }, + ], + pagination: { + total: 100, + }, + }, + }, + }, +]; + +export const getBinaryOptionsMarketExample = [ + { + user: "{{user1}}", + content: { + text: "Lookup binary options market with market ID '0x...'.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Binary options market retrieved successfully.", + action: "GET_BINARY_OPTIONS_MARKET", + content: { + market: { + marketId: "0x...", + marketStatus: "active", + ticker: "BTC>25000-240630", + oracleSymbol: "BTC", + oracleProvider: "band", + oracleScaleFactor: 6, + quoteDenom: "usdt", + makerFeeRate: "0.001", + takerFeeRate: "0.002", + expirationTimestamp: 1719705600, + settlementTimestamp: 1719792000, + serviceProviderFee: "0.4", + minPriceTickSize: 0.01, + minQuantityTickSize: 0.001, + }, + }, + }, + }, +]; + +export const msgCreateBinaryOptionsMarketExample = [ + { + user: "{{user1}}", + content: { + text: "Create a new binary options market with ticker 'BTC/USD', oracle 'band', expiry time 1641945600, settlement time 1641945600, admin 'inj1...', quote denom 'inj', min price tick size '0.000001', and min quantity tick size '0.000001'.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Binary options market created successfully.", + action: "MSG_CREATE_BINARY_OPTIONS_MARKET", + content: { + marketId: "0x...", + success: true, + txHash: "0x...", + }, + }, + }, +]; + +export const getSubaccountTradeNonceExample = [ + { + user: "{{user1}}", + content: { + text: "Get trade nonce for subaccount ID 'subaccount_id'.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Subaccount trade nonce retrieved successfully.", + action: "GET_SUBACCOUNT_TRADE_NONCE", + content: { + nonce: 5, + }, + }, + }, +]; + +export const getPositionsV2Example = [ + { + user: "{{user1}}", + content: { + text: "Query positions V2 for account 'inj1...', market ID 'market_id', subaccount ID 'subaccount_id', direction 'long' with pagination from 1 to 100 and limit 10.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Positions V2 retrieved successfully.", + action: "GET_POSITIONS_V2", + content: { + positions: [ + { + marketId: "market_id", + subaccountId: "subaccount_id", + direction: "long", + quantity: "1.5", + entryPrice: "25000.5", + margin: "1000", + liquidationPrice: "24000.0", + markPrice: "25100.0", + ticker: "BTC/USDT", + aggregateReduceOnlyQuantity: "0", + updatedAt: 1641859200, + }, + ], + pagination: { + total: 100, + }, + }, + }, + }, +]; + +export const getHistoricalBalanceExample = [ + { + user: "{{user1}}", + content: { + text: "Get historical balance for account 'inj1...' with daily resolution.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Historical balance data retrieved successfully.", + action: "GET_HISTORICAL_BALANCE", + content: { + t: [1641859200, 1641945600], + v: [1000.5, 1100.75], + }, + }, + }, +]; + +export const getHistoricalRpnlExample = [ + { + user: "{{user1}}", + content: { + text: "Get historical RPNL for account 'inj1...' with daily resolution.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Historical RPNL data retrieved successfully.", + action: "GET_HISTORICAL_RPNL", + content: { + t: [1641859200, 1641945600], + v: [1000.5, 1100.75], + }, + }, + }, +]; + +export const getHistoricalVolumesExample = [ + { + user: "{{user1}}", + content: { + text: "Get historical volumes for account 'inj1...' with daily resolution.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Historical volumes data retrieved successfully.", + action: "GET_HISTORICAL_VOLUMES", + content: { + t: [1641859200, 1641945600], + v: [50000.5, 75000.25], + }, + }, + }, +]; + +export const getDenomHoldersExample = [ + { + user: "{{user1}}", + content: { + text: "Get holders of denom 'inj' with token address '0x...' and limit 100.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Denom holders retrieved successfully.", + action: "GET_DENOM_HOLDERS", + content: { + holders: [ + { + accountAddress: "inj1...", + balance: "1000000", + }, + ], + next: ["next_key"], + }, + }, + }, +]; + +export const getGridStrategiesExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve grid strategies with limit 100, state 'active', market ID 'market_id', market type 'uniform', subaccount ID 'subaccount_id', and account address 'inj1...'.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Grid strategies retrieved successfully.", + action: "GET_GRID_STRATEGIES", + content: { + strategies: [ + { + id: "strategy_id", + accountAddress: "inj1...", + subaccountId: "subaccount_id", + marketId: "market_id", + strategyType: "uniform", + tickSize: "0.1", + minPrice: "24000.0", + maxPrice: "26000.0", + gridCount: 20, + state: "active", + totalVolume: "100000.5", + currentPnL: "1000.25", + createdAt: 1641859200, + updatedAt: 1641945600, + }, + ], + }, + }, + }, +]; + +export const msgInstantSpotMarketLaunchExample = [ + { + user: "{{user1}}", + content: { + text: "Instantly launch a spot market with ticker 'INJ/USDT', base denom 'inj', quote denom 'usdt', min price tick size '0.000001', and min quantity tick size '0.000001'.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Instant spot market launched successfully.", + action: "MSG_INSTANT_SPOT_MARKET_LAUNCH", + content: { + marketId: "0x...", + success: true, + txHash: "0x...", + }, + }, + }, +]; + +export const getFundingPaymentsExample = [ + { + user: "{{user1}}", + content: { + text: "Fetch funding payments for market ID '0x...' and subaccount ID '0x...' with pagination from 1 to 100 and limit 10.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Funding payments retrieved successfully.", + action: "GET_FUNDING_PAYMENTS", + content: { + fundingPayments: [ + { + marketId: "0x...", + subaccountId: "0x...", + amount: "100.5", + timestamp: 1641859200, + }, + ], + pagination: { + total: 100, + }, + }, + }, + }, +]; + +export const getPnlLeaderboardExample = [ + { + user: "{{user1}}", + content: { + text: "Get PnL leaderboard for the period from '2024-01-01' to '2024-01-31' with limit 100 and account filter 'inj1...'.", + }, + }, + { + user: "{{agent}}", + content: { + text: "PnL leaderboard retrieved successfully.", + action: "GET_PNL_LEADERBOARD", + content: { + firstDate: "2024-01-01", + lastDate: "2024-01-31", + leaders: [ + { + account: "inj1...", + pnl: 100000.5, + volume: 1000000.0, + rank: 1, + }, + ], + accountRow: { + account: "inj1...", + pnl: 50000.25, + volume: 500000.0, + rank: 10, + }, + }, + }, + }, +]; + +export const getVolLeaderboardExample = [ + { + user: "{{user1}}", + content: { + text: "Get volume leaderboard for the period from '2024-01-01' to '2024-01-31' with limit 100 and account filter 'inj1...'.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Volume leaderboard retrieved successfully.", + action: "GET_VOL_LEADERBOARD", + content: { + firstDate: "2024-01-01", + lastDate: "2024-01-31", + leaders: [ + { + account: "inj1...", + volume: 1000000.0, + rank: 1, + }, + ], + accountRow: { + account: "inj1...", + volume: 500000.0, + rank: 10, + }, + }, + }, + }, +]; + +export const getPnlLeaderboardFixedResolutionExample = [ + { + user: "{{user1}}", + content: { + text: "Get PnL leaderboard with daily resolution, limit 100, and account filter 'inj1...'.", + }, + }, + { + user: "{{agent}}", + content: { + text: "PnL leaderboard with fixed resolution retrieved successfully.", + action: "GET_PNL_LEADERBOARD_FIXED_RESOLUTION", + content: { + firstDate: "2024-01-01", + lastDate: "2024-01-31", + leaders: [ + { + account: "inj1...", + pnl: 100000.5, + volume: 1000000.0, + rank: 1, + }, + ], + accountRow: { + account: "inj1...", + pnl: 50000.25, + volume: 500000.0, + rank: 10, + }, + }, + }, + }, +]; + +export const getVolLeaderboardFixedResolutionExample = [ + { + user: "{{user1}}", + content: { + text: "Get volume leaderboard with daily resolution, limit 100, and account filter 'inj1...'.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Volume leaderboard with fixed resolution retrieved successfully.", + action: "GET_VOL_LEADERBOARD_FIXED_RESOLUTION", + content: { + firstDate: "2024-01-01", + lastDate: "2024-01-31", + leaders: [ + { + account: "inj1...", + volume: 1000000.0, + rank: 1, + }, + ], + accountRow: { + account: "inj1...", + volume: 500000.0, + rank: 10, + }, + }, + }, + }, +]; + +export const getAtomicSwapHistoryExample = [ + { + user: "{{user1}}", + content: { + text: "Get atomic swap history for address 'inj1...', contract address '0x...', with pagination from 1 to 100 and limit 10.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Atomic swap history retrieved successfully.", + action: "GET_ATOMIC_SWAP_HISTORY", + content: { + swapHistory: [ + { + sender: "inj1...", + route: "route_id", + sourceCoin: { + amount: "1000000", + denom: "inj", + }, + destinationCoin: { + amount: "900000", + denom: "usdt", + }, + fees: [ + { + amount: "1000", + denom: "inj", + }, + ], + contractAddress: "0x...", + indexBySender: 1, + indexBySenderContract: 1, + txHash: "0x...", + executedAt: 1641859200, + }, + ], + pagination: { + total: 100, + }, + }, + }, + }, +]; + +export const getIsOptedOutOfRewardsExample = [ + { + user: "{{user1}}", + content: { + text: "Check if account 'inj1...' has opted out of rewards.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Opt-out status retrieved successfully.", + action: "GET_IS_OPTED_OUT_OF_REWARDS", + content: { + isOptedOut: true, + }, + }, + }, +]; + +export const getBinaryOptionsMarketsV2Example = [ + { + user: "{{user1}}", + content: { + text: "Retrieve all binary options markets with quote denom 'usdt' and market status 'active' and 'paused'.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Binary options markets retrieved successfully.", + action: "GET_BINARY_OPTIONS_MARKETS_V2", + content: { + markets: [ + { + marketId: "0x...", + marketStatus: "active", + ticker: "BTC>25000-240630", + oracleSymbol: "BTC", + oracleProvider: "band", + oracleScaleFactor: 6, + quoteDenom: "usdt", + makerFeeRate: "0.001", + takerFeeRate: "0.002", + expirationTimestamp: 1719705600, + settlementTimestamp: 1719792000, + serviceProviderFee: "0.4", + minPriceTickSize: 0.01, + minQuantityTickSize: 0.001, + }, + ], + pagination: { + total: 100, + }, + }, + }, + }, +]; + +export const getTradingRewardsExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve trading rewards for account 'inj1...' and epoch 1.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Trading rewards retrieved successfully.", + action: "GET_TRADING_REWARDS", + content: { + rewards: [ + { + accountAddress: "inj1...", + rewards: [ + { + amount: "1000000", + denom: "inj", + }, + ], + distributedAt: 1641859200, + }, + ], + }, + }, + }, +]; + +export const getSubaccountOrderSummaryExample = [ + { + user: "{{user1}}", + content: { + text: "Get order summary for subaccount ID '0x...', market ID '0x...', and order direction 'buy'.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Order summary retrieved successfully.", + action: "GET_SUBACCOUNT_ORDER_SUMMARY", + content: { + spotOrdersTotal: "10", + derivativeOrdersTotal: "5", + spotOrdersActiveTotal: "3", + derivativeOrdersActiveTotal: "2", + spotOrdersCancelledTotal: "5", + derivativeOrdersCancelledTotal: "2", + spotOrdersFilledTotal: "2", + derivativeOrdersFilledTotal: "1", + }, + }, + }, +]; + +export const getDerivativeMarketsExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve all derivative markets", + }, + }, + { + user: "{{agent}}", + content: { + text: "Derivative markets retrieved successfully.", + action: "GET_DERIVATIVE_MARKETS", + content: { + markets: [ + { + marketId: "0x...", + marketStatus: "active", + ticker: "BTC/USDT PERP", + oracleBase: "BTC", + oracleQuote: "USDT", + quoteDenom: "usdt", + makerFeeRate: "0.001", + takerFeeRate: "0.002", + serviceProviderFee: "0.4", + isPerpetual: true, + minPriceTickSize: 0.01, + minQuantityTickSize: 0.001, + }, + ], + }, + }, + }, +]; + +export const getSpotMarketsExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve all spot markets with base denom 'inj', quote denom 'usdt', market status 'active' and 'paused'.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Spot markets retrieved successfully.", + action: "GET_SPOT_MARKETS", + content: { + markets: [ + { + marketId: "0x...", + marketStatus: "active", + ticker: "INJ/USDT", + baseDenom: "inj", + quoteDenom: "usdt", + makerFeeRate: "0.001", + takerFeeRate: "0.002", + serviceProviderFee: "0.4", + minPriceTickSize: 0.000001, + minQuantityTickSize: 0.000001, + }, + ], + }, + }, + }, +]; + +export const getSubaccountsListExample = [ + { + user: "{{user1}}", + content: { + text: "Get list of subaccounts for address 'inj1...'.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Subaccounts list retrieved successfully.", + action: "GET_SUBACCOUNTS_LIST", + content: { + subaccounts: ["0x..."], + }, + }, + }, +]; + +export const getSubaccountBalancesListExample = [ + { + user: "{{user1}}", + content: { + text: "Get balances for subaccount ID '0x...'.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Subaccount balances retrieved successfully.", + action: "GET_SUBACCOUNT_BALANCES_LIST", + content: { + balances: [ + { + subaccountId: "0x...", + accountAddress: "inj1...", + denom: "inj", + deposit: { + totalBalance: "1000000", + availableBalance: "900000", + }, + }, + ], + }, + }, + }, +]; + +export const getDerivativeOrderbooksV2Example = [ + { + user: "{{user1}}", + content: { + text: "Get derivative orderbooks for market IDs ['0x...'].", + }, + }, + { + user: "{{agent}}", + content: { + text: "Derivative orderbooks retrieved successfully.", + action: "GET_DERIVATIVE_ORDERBOOKS_V2", + content: { + orderbooks: [ + { + marketId: "0x12...", + orderbook: { + sequence: "123", + buys: [ + { + price: "25000.5", + quantity: "1.5", + timestamp: 1641859200, + }, + ], + sells: [ + { + price: "25100.5", + quantity: "0.5", + timestamp: 1641859200, + }, + ], + }, + }, + { + marketId: "0x212...", + orderbook: { + sequence: "123", + buys: [ + { + price: "2500.5", + quantity: "1", + timestamp: 1641859201, + }, + ], + sells: [ + { + price: "2510.5", + quantity: "0.5", + timestamp: 1641859203, + }, + ], + }, + }, + ], + }, + }, + }, +]; + +export const getDerivativeOrderbookV2Example = [ + { + user: "{{user1}}", + content: { + text: "Get derivative orderbook for market ID '0x...'.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Derivative orderbooks retrieved successfully.", + action: "GET_DERIVATIVE_ORDERBOOK_V2", + content: { + orderbook: [ + { + marketId: "0x...", + orderbook: { + sequence: "123", + buys: [ + { + price: "25000.5", + quantity: "1.5", + timestamp: 1641859200, + }, + ], + sells: [ + { + price: "25100.5", + quantity: "0.5", + timestamp: 1641859200, + }, + ], + }, + }, + ], + }, + }, + }, +]; + +export const getSpotOrderbooksV2Example = [ + { + user: "{{user1}}", + content: { + text: "Get orderbooks for market IDs ['0x...'].", + }, + }, + { + user: "{{agent}}", + content: { + text: "Spot orderbooks retrieved successfully.", + action: "GET_SPOT_ORDERBOOKS_V2", + content: { + orderbooks: [ + { + marketId: "0x...", + orderbook: { + sequence: "123", + buys: [ + { + price: "25000.5", + quantity: "1.5", + timestamp: 1641859200, + }, + ], + sells: [ + { + price: "25100.5", + quantity: "0.5", + timestamp: 1641859200, + }, + ], + }, + }, + ], + }, + }, + }, +]; + +export const getSpotOrderbookV2Example = [ + { + user: "{{user1}}", + content: { + text: "Get spot orderbook for market ID '0x...'.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Spot orderbook retrieved successfully.", + action: "GET_SPOT_ORDERBOOK_V2", + content: { + orderbook: [ + { + marketId: "0x...", + orderbook: { + sequence: "123", + buys: [ + { + price: "25000.5", + quantity: "1.5", + timestamp: 1641859200, + }, + ], + sells: [ + { + price: "25100.5", + quantity: "0.5", + timestamp: 1641859200, + }, + ], + }, + }, + ], + }, + }, + }, +]; + +export const msgBatchCancelBinaryOptionsOrdersExample = [ + { + user: "{{user1}}", + content: { + text: "Batch cancel binary options orders for injective address 'inj1...' with orders [{'marketId': '0x...', 'subaccountId': '0x...', 'orderHash': '0x...'}].", + }, + }, + { + user: "{{agent}}", + content: { + text: "Batch binary options orders canceled successfully.", + action: "MSG_BATCH_CANCEL_BINARY_OPTIONS_ORDERS", + content: { + success: true, + txHash: "0x...", + }, + }, + }, +]; + +export const msgCancelBinaryOptionsOrderExample = [ + { + user: "{{user1}}", + content: { + text: "Cancel binary options order with order hash '0x...' for injective address 'inj1...', market ID '0x...', and subaccount ID '0x...'.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Binary options order canceled successfully.", + action: "MSG_CANCEL_BINARY_OPTIONS_ORDER", + content: { + success: true, + txHash: "0x...", + }, + }, + }, +]; + +export const msgCreateBinaryOptionsLimitOrderExample = [ + { + user: "{{user1}}", + content: { + text: "Create a binary options limit order to BUY 1.5 BTC>25000-240630 at price 25000.5 for subaccount '0x...' with fee recipient 'inj1...'.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Binary options limit order created successfully.", + action: "MSG_CREATE_BINARY_OPTIONS_LIMIT_ORDER", + content: { + orderHash: "0x...", + txHash: "0x...", + }, + }, + }, +]; + +export const msgLiquidatePositionExample = [ + { + user: "{{user1}}", + content: { + text: "Liquidate position for subaccount '0x...' in market '0x...' with order { marketId: '0x...', orderType: 'SELL', price: '24000.0', quantity: '1.5', margin: '1000' }.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Position liquidated successfully.", + action: "MSG_LIQUIDATE_POSITION", + content: { + success: true, + txHash: "0x...", + }, + }, + }, +]; + +export const msgReclaimLockedFundsExample = [ + { + user: "{{user1}}", + content: { + text: "Reclaim locked funds for injective address 'inj1...' with locked account public key '0x...' and signature '0x...'.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Locked funds reclaimed successfully.", + action: "MSG_RECLAIM_LOCKED_FUNDS", + content: { + success: true, + txHash: "0x...", + }, + }, + }, +]; + +export const msgSignDataExample = [ + { + user: "{{user1}}", + content: { + text: "Sign data '0x...' for injective address 'inj1...'.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Data signed successfully.", + action: "MSG_SIGN_DATA", + content: { + signature: "0x...", + success: true, + txHash: "0x...", + }, + }, + }, +]; + +export const msgCreateSpotLimitOrderExample = [ + { + user: "{{user1}}", + content: { + text: "Create a spot limit order to BUY 1.5 INJ at price 25000.5 for subaccount '0x...' with fee recipient 'inj1...'.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Spot limit order created successfully.", + action: "MSG_CREATE_SPOT_LIMIT_ORDER", + content: { + orderHash: "0x...", + txHash: "0x...", + }, + }, + }, +]; + +export const msgCreateDerivativeLimitOrderExample = [ + { + user: "{{user1}}", + content: { + text: "Create a derivative limit order to BUY 1.5 BTC/USDT PERP at price 25000.5 with margin 1000 for subaccount '0x...' and fee recipient 'inj1...'.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Derivative limit order created successfully.", + action: "MSG_CREATE_DERIVATIVE_LIMIT_ORDER", + content: { + orderHash: "0x...", + txHash: "0x...", + }, + }, + }, +]; + +export const msgBatchCancelSpotOrdersExample = [ + { + user: "{{user1}}", + content: { + text: "Batch cancel spot orders for injective address 'inj1...' with orders [{'marketId': '0x...', 'subaccountId': '0x...', 'orderHash': '0x...'}].", + }, + }, + { + user: "{{agent}}", + content: { + text: "Batch spot orders canceled successfully.", + action: "MSG_BATCH_CANCEL_SPOT_ORDERS", + content: { + success: true, + txHash: "0x...", + }, + }, + }, +]; + +export const msgBatchCancelDerivativeOrdersExample = [ + { + user: "{{user1}}", + content: { + text: "Batch cancel derivative orders for injective address 'inj1...' with orders [{'marketId': '0x...', 'subaccountId': '0x...', 'orderHash': '0x...'}].", + }, + }, + { + user: "{{agent}}", + content: { + text: "Batch derivative orders canceled successfully.", + action: "MSG_BATCH_CANCEL_DERIVATIVE_ORDERS", + content: { + success: true, + txHash: "0x...", + }, + }, + }, +]; + +export const msgCancelSpotOrderExample = [ + { + user: "{{user1}}", + content: { + text: "Cancel spot order with order hash '0x...' for injective address 'inj1...', market ID '0x...', and subaccount ID '0x...'.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Spot order canceled successfully.", + action: "MSG_CANCEL_SPOT_ORDER", + content: { + success: true, + txHash: "0x...", + }, + }, + }, +]; + +export const msgCancelDerivativeOrderExample = [ + { + user: "{{user1}}", + content: { + text: "Cancel derivative order with order hash '0x...' for injective address 'inj1...', market ID '0x...', and subaccount ID '0x...'.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Derivative order canceled successfully.", + action: "MSG_CANCEL_DERIVATIVE_ORDER", + content: { + success: true, + txHash: "0x...", + }, + }, + }, +]; + +export const getSpotSubaccountOrdersListExample = [ + { + user: "{{user1}}", + content: { + text: "Get spot orders list for subaccount ID '0x...', market ID '0x...', with pagination from 1 to 100 and limit 10.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Spot subaccount orders list retrieved successfully.", + action: "GET_SPOT_SUBACCOUNT_ORDERS_LIST", + content: { + orders: [ + { + orderHash: "0x...", + orderSide: "buy", + marketId: "0x...", + subaccountId: "0x...", + price: "25000.5", + quantity: "1.5", + unfilledQuantity: "0.5", + triggerPrice: "0", + feeRecipient: "inj1...", + state: "booked", + createdAt: 1641859200, + updatedAt: 1641859200, + }, + ], + pagination: { + total: 100, + }, + }, + }, + }, +]; + +export const getSpotSubaccountTradesListExample = [ + { + user: "{{user1}}", + content: { + text: "Get spot trades list for subaccount ID '0x...', market ID '0x...', direction 'buy', execution type 'market', with pagination from 1 to 100 and limit 10.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Spot subaccount trades list retrieved successfully.", + action: "GET_SPOT_SUBACCOUNT_TRADES_LIST", + content: { + trades: [ + { + orderHash: "0x...", + subaccountId: "0x...", + marketId: "0x...", + tradeId: "trade_id", + executedAt: 1641859200, + executionSide: "taker", + tradeExecutionType: "market", + tradeDirection: "buy", + price: "25000.5", + quantity: "1.5", + fee: "25.0", + feeRecipient: "inj1...", + }, + ], + pagination: { + total: 100, + }, + }, + }, + }, +]; + +export const msgCreateBinaryOptionsMarketOrderExample = [ + { + user: "{{user1}}", + content: { + text: "Create a binary options market order to BUY 1.5 BTC>25000-240630 at price 25000.5 for subaccount '0x...' with fee recipient 'inj1...'.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Binary options market order created successfully.", + action: "MSG_CREATE_BINARY_OPTIONS_MARKET_ORDER", + content: { + orderHash: "0x...", + txHash: "0x...", + }, + }, + }, +]; + +export const getSpotOrderHistoryExample = [ + { + user: "{{user1}}", + content: { + text: "Get spot order history for subaccount ID '0x...', market ID '0x...', market IDs ['0x...'], order types ['limit', 'market'], execution types ['limit', 'market'], direction 'buy', is conditional false, state 'booked', with pagination from 1 to 100 and limit 10.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Spot order history retrieved successfully.", + action: "GET_SPOT_ORDER_HISTORY", + content: { + orderHistory: [ + { + orderHash: "0x...", + marketId: "0x...", + active: true, + subaccountId: "0x...", + executionType: "limit", + orderType: "buy", + price: "25000.5", + triggerPrice: "0", + quantity: "1.5", + filledQuantity: "0.5", + state: "booked", + createdAt: 1641859200, + updatedAt: 1641859200, + direction: "buy", + }, + ], + pagination: { + total: 100, + }, + }, + }, + }, +]; + +export const getSpotTradesExample = [ + { + user: "{{user1}}", + content: { + text: "Get spot trades for market IDs ['0x...'], subaccount ID '0x...', execution side 'taker', direction 'buy', execution types ['market', 'limit'], with pagination from 1 to 100 and limit 10.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Spot trades retrieved successfully.", + action: "GET_SPOT_TRADES", + content: { + trades: [ + { + orderHash: "0x...", + subaccountId: "0x...", + marketId: "0x...", + tradeId: "trade_id", + executedAt: 1641859200, + executionSide: "taker", + tradeExecutionType: "market", + tradeDirection: "buy", + price: "25000.5", + quantity: "1.5", + fee: "25.0", + feeRecipient: "inj1...", + }, + ], + pagination: { + total: 100, + }, + }, + }, + }, +]; + +export const getAccountPortfolioBalancesExample = [ + { + user: "{{user1}}", + content: { + text: "Get account portfolio balances for address 'inj1...'.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Account portfolio balances retrieved successfully.", + action: "GET_ACCOUNT_PORTFOLIO_BALANCES", + content: { + balances: [ + { + denom: "inj", + totalBalance: "1000000", + availableBalance: "900000", + lockedBalance: "100000", + }, + ], + subaccountBalances: [ + { + subaccountId: "0x...", + denom: "inj", + deposit: { + totalBalance: "1000000", + availableBalance: "900000", + }, + }, + ], + }, + }, + }, +]; + +export const getRewardsExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve rewards for account 'inj1...' and epoch 1.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Rewards retrieved successfully.", + action: "GET_REWARDS", + content: { + rewards: [ + { + accountAddress: "inj1...", + rewards: [ + { + amount: "1000000", + denom: "inj", + }, + ], + distributedAt: 1641859200, + }, + ], + }, + }, + }, +]; + +export const getDerivativeOrderHistoryExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve derivative order history for subaccount ID '0x...', market ID '0x...', multiple market IDs ['0x...', '0x...'], order types ['limit', 'market'], execution types ['limit', 'market'], direction 'buy', non-conditional, state 'booked', with pagination from 1 to 100 and limit 10.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Derivative order history retrieved successfully.", + action: "GET_DERIVATIVE_ORDER_HISTORY", + content: { + orderHistory: [ + { + orderHash: "0xabc123...", + marketId: "0xmarket1...", + isActive: true, + subaccountId: "0xsubaccount1...", + executionType: "limit", + orderType: "buy", + price: "25000.5", + triggerPrice: "0", + quantity: "1.5", + filledQuantity: "0.5", + state: "booked", + createdAt: 1641859200, + updatedAt: 1641859200, + direction: "buy", + isConditional: false, + triggerAt: 0, + margin: "1000", + }, + // ...additional order history entries + ], + pagination: { + total: 50, + }, + }, + }, + }, +]; + +export const getDerivativeTradesExample = [ + { + user: "{{user1}}", + content: { + text: "Fetch derivative trades for market ID '0x...', multiple market IDs ['0x...', '0x...'], subaccount ID '0x...', execution side 'taker', direction 'buy', execution types ['market', 'limit'], with pagination from 1 to 100 and limit 10.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Derivative trades retrieved successfully.", + action: "GET_DERIVATIVE_TRADES", + content: { + trades: [ + { + orderHash: "0xabc123...", + subaccountId: "0xsubaccount1...", + marketId: "0xmarket1...", + tradeId: "trade_001", + executedAt: 1641859200, + tradeExecutionType: "market", + executionSide: "taker", + tradeDirection: "buy", + executionPrice: "25000.5", + executionQuantity: "1.5", + executionMargin: "1000", + fee: "25.0", + feeRecipient: "inj1...", + isLiquidation: false, + payout: "37525.75", + }, + ], + pagination: { + total: 30, + }, + }, + }, + }, +]; + +export const getOrderStatesExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve order states for subaccount ID '0x...', market ID '0x...', with order hashes ['0xorder1...', '0xorder2...'].", + }, + }, + { + user: "{{agent}}", + content: { + text: "Order states retrieved successfully.", + action: "GET_ORDER_STATES", + content: { + orders: [ + { + orderHash: "0xorder1...", + state: "filled", + filledQuantity: "1.0", + remainingQuantity: "0.0", + filledAt: 1641859200, + }, + { + orderHash: "0xorder2...", + state: "cancelled", + filledQuantity: "0.0", + remainingQuantity: "2.0", + filledAt: 0, + }, + ], + }, + }, + }, +]; + +export const msgIncreasePositionMarginExample = [ + { + user: "{{user1}}", + content: { + text: "Increase position margin by 1,000 INJ for subaccount '0x...', market ID '0x...'.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Position margin increased successfully.", + action: "MSG_INCREASE_POSITION_MARGIN", + content: { + success: true, + txHash: "0xdef456...", + }, + }, + }, +]; + +export const msgRewardsOptOutExample = [ + { + user: "{{user1}}", + content: { + text: "Opt out of trading rewards for account 'inj1...'.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Successfully opted out of rewards.", + action: "MSG_REWARDS_OPT_OUT", + content: { + success: true, + txHash: "0xghi789...", + }, + }, + }, +]; + +export const msgExternalTransferExample = [ + { + user: "{{user1}}", + content: { + text: "Transfer 1,000,000 INJ from subaccount '0xsource...' to subaccount '0xdestination...'.", + }, + }, + { + user: "{{agent}}", + content: { + text: "External transfer completed successfully.", + action: "MSG_EXTERNAL_TRANSFER", + content: { + success: true, + txHash: "0xjkl012...", + }, + }, + }, +]; diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/examples/explorer.ts b/packages/plugin-injective/injective-sdk-client-ts/src/examples/explorer.ts new file mode 100644 index 00000000000..ba205aa6674 --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/examples/explorer.ts @@ -0,0 +1,359 @@ +export const getTxByHashExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve transaction details for hash 0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Transaction details retrieved successfully.", + action: "GET_TX_BY_HASH", + content: { + id: "tx_id_12345", + blockNumber: 12345, + blockTimestamp: "2024-01-11T12:00:00Z", + hash: "0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890", + memo: "Payment for services", + code: 0, + data: "base64EncodedDataHere", + info: "Transaction executed successfully", + gasWanted: 100000, + gasUsed: 80000, + gasFee: { + amounts: [ + { + amount: "1000000", + denom: "inj", + }, + ], + gasLimit: 100000, + payer: "inj1payeraddress...", + granter: "inj1granteraddress...", + }, + txType: "MsgSend", + signatures: [ + { + pubkey: "cosmospub1addwnpepq...", + address: "inj1senderaddress...", + signature: "signatureDataHere", + sequence: 5, + }, + ], + messages: [ + { + key: "recipient", + value: "inj1recipientaddress...", + }, + ], + }, + }, + }, +]; + +export const getAccountTxExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve the latest 10 transactions for account address inj1accountaddress...", + }, + }, + { + user: "{{agent}}", + content: { + text: "Account transactions retrieved successfully.", + action: "GET_ACCOUNT_TX", + content: { + txs: [ + { + id: "tx_id_12345", + blockNumber: 12345, + blockTimestamp: "2024-01-11T12:00:00Z", + hash: "0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890", + txType: "MsgSend", + }, + // ...additional transactions + ], + pagination: { + total: 100, + }, + }, + }, + }, +]; + +export const getValidatorExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve details for validator address injvaloper1validatoraddress...", + }, + }, + { + user: "{{agent}}", + content: { + text: "Validator details retrieved successfully.", + action: "GET_EXPLORER_VALIDATOR", + content: { + id: "validator_id_123", + moniker: "ValidatorMoniker", + operatorAddress: "injvaloper1validatoraddress...", + consensusAddress: "injvalcons1validatorconsensus...", + jailed: false, + status: 1, + tokens: "1000000000", + delegatorShares: "1000000000", + description: { + moniker: "ValidatorMoniker", + identity: "validatorIdentity", + website: "https://validatorwebsite.com", + securityContact: "security@validator.com", + details: "Detailed description of the validator.", + }, + uptimePercentage: 99.9, + commissionRate: "0.1", + commissionMaxRate: "0.2", + commissionMaxChangeRate: "0.01", + }, + }, + }, +]; + +export const getValidatorUptimeExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve uptime details for validator address injvaloper1validatoraddress...", + }, + }, + { + user: "{{agent}}", + content: { + text: "Validator uptime details retrieved successfully.", + action: "GET_VALIDATOR_UPTIME", + content: [ + { + blockNumber: 12345, + status: "signed", + }, + { + blockNumber: 12346, + status: "missed", + }, + // ...additional uptime records + ], + }, + }, +]; + +export const getPeggyDepositTxsExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve Peggy deposit transactions for sender eth1senderaddress and receiver inj1receiveraddress...", + }, + }, + { + user: "{{agent}}", + content: { + text: "Peggy deposit transactions retrieved successfully.", + action: "GET_PEGGY_DEPOSIT_TXS", + content: [ + { + sender: "eth1senderaddress", + receiver: "inj1receiveraddress", + eventNonce: 123, + eventHeight: 12345, + amount: "1000000000", + denom: "peggy0xabcdef", + orchestratorAddress: "inj1orchestratoraddress", + state: "completed", + txHashesList: [ + "0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890", + ], + }, + // ...additional deposit transactions + ], + }, + }, +]; + +export const getPeggyWithdrawalTxsExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve Peggy withdrawal transactions for sender inj1senderaddress and receiver eth1receiveraddress...", + }, + }, + { + user: "{{agent}}", + content: { + text: "Peggy withdrawal transactions retrieved successfully.", + action: "GET_PEGGY_WITHDRAWAL_TXS", + content: [ + { + sender: "inj1senderaddress", + receiver: "eth1receiveraddress", + amount: "1000000000", + denom: "peggy0xabcdef", + bridgeFee: "1000000", + outgoingTxId: 123, + batchTimeout: 100, + batchNonce: 5, + state: "completed", + txHashesList: [ + "0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890", + ], + }, + // ...additional withdrawal transactions + ], + }, + }, +]; + +export const getBlocksExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve the latest 10 blocks before block number 12345 and after block number 12300...", + }, + }, + { + user: "{{agent}}", + content: { + text: "Blocks retrieved successfully.", + action: "GET_BLOCKS", + content: { + blocks: [ + { + height: 12345, + proposer: "injvaloper1proposeraddress...", + moniker: "ProposerMoniker", + blockHash: "0xblockhash1234567890abcdef...", + parentHash: "0xparenthash1234567890abcdef...", + numPreCommits: 150, + numTxs: 10, + timestamp: "2024-01-11T12:00:00Z", + }, + // ...additional blocks + ], + }, + }, + }, +]; + +export const getBlockExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve details for block with height 12345.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Block details retrieved successfully.", + action: "GET_BLOCK", + content: { + block: { + height: 12345, + proposer: "injvaloper1proposeraddress...", + moniker: "ProposerMoniker", + blockHash: "0xblockhash1234567890abcdef...", + parentHash: "0xparenthash1234567890abcdef...", + numPreCommits: 150, + numTxs: 10, + timestamp: "2024-01-11T12:00:00Z", + }, + }, + }, + }, +]; + +export const getTxsExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve transactions of type MsgSend from the bank module between block numbers 12300 and 12345, limited to 10 results.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Transactions retrieved successfully.", + action: "GET_TXS", + content: { + transactions: [ + { + id: "tx_id_12345", + blockNumber: 12345, + blockTimestamp: "2024-01-11T12:00:00Z", + hash: "0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890", + txType: "MsgSend", + }, + // ...additional transactions + ], + }, + }, + }, +]; + +export const getIBCTransferTxsExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve IBC transfer transactions sent by inj1senderaddress to cosmos1receiveraddress through source channel channel-1 and destination channel channel-0, limited to 10 results.", + }, + }, + { + user: "{{agent}}", + content: { + text: "IBC transfer transactions retrieved successfully.", + action: "GET_IBC_TRANSFER_TXS", + content: [ + { + sender: "inj1senderaddress", + receiver: "cosmos1receiveraddress", + sourcePort: "transfer", + sourceChannel: "channel-1", + destinationPort: "transfer", + destinationChannel: "channel-0", + amount: "1000000000", + denom: "inj", + timeoutHeight: "1-1000000", + timeoutTimestamp: 1641945600, + state: "completed", + }, + // ...additional IBC transfer transactions + ], + }, + }, +]; + +export const getExplorerStatsExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve the latest explorer statistics.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Explorer statistics retrieved successfully.", + action: "GET_EXPLORER_STATS", + content: { + assets: "1000", + txsTotal: "1000000", + addresses: "50000", + injSupply: "100000000", + txsInPast30Days: "100000", + txsInPast24Hours: "10000", + blockCountInPast24Hours: "5000", + txsPerSecondInPast24Hours: "0.5", + txsPerSecondInPast100Blocks: "0.8", + }, + }, + }, +]; diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/examples/gov.ts b/packages/plugin-injective/injective-sdk-client-ts/src/examples/gov.ts new file mode 100644 index 00000000000..a0c93c275ac --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/examples/gov.ts @@ -0,0 +1,373 @@ +export const getGovernanceModuleParamsExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve governance module parameters, including votingParams, tallyParams, and depositParams.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Governance module parameters retrieved successfully.", + action: "GET_GOVERNANCE_MODULE_PARAMS", + content: { + votingParams: { + votingPeriod: 604800, + }, + tallyParams: { + quorum: "0.334", + threshold: "0.5", + vetoThreshold: "0.334", + }, + depositParams: { + minDepositList: [ + { + denom: "inj", + amount: "100000000000000000000", + }, + ], + maxDepositPeriod: 1209600, + }, + }, + }, + }, +]; + +export const getProposalsExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve proposals with status 2 and paginate the results with a limit of 100.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Proposals retrieved successfully.", + action: "GET_PROPOSALS", + content: { + proposals: [ + { + proposalId: 1, + title: "Example Proposal", + summary: "This is an example proposal", + proposer: "inj1proposeraddress...", + status: 2, + finalTallyResult: { + yesCount: "100", + abstainCount: "10", + noCount: "5", + noWithVetoCount: "2", + }, + submitTime: 1632150400, + depositEndTime: 1633360000, + votingStartTime: 1633360000, + votingEndTime: 1633964800, + totalDeposits: [ + { + denom: "inj", + amount: "100000000000000000000", + }, + ], + }, + // ...additional proposals + ], + pagination: { + nextKey: "", + total: 100, + }, + }, + }, + }, +]; + +export const getProposalExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve details for proposal with ID 1.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Proposal details retrieved successfully.", + action: "GET_PROPOSAL", + content: { + proposalId: 1, + title: "Example Proposal", + summary: "This is an example proposal", + proposer: "inj1proposeraddress...", + status: 2, + finalTallyResult: { + yesCount: "100", + abstainCount: "10", + noCount: "5", + noWithVetoCount: "2", + }, + submitTime: 1632150400, + depositEndTime: 1633360000, + votingStartTime: 1633360000, + votingEndTime: 1633964800, + totalDeposits: [ + { + denom: "inj", + amount: "100000000000000000000", + }, + ], + }, + }, + }, +]; + +export const getProposalDepositsExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve deposits for proposal ID 1 with pagination parameters.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Proposal deposits retrieved successfully.", + action: "GET_PROPOSAL_DEPOSITS", + content: { + deposits: [ + { + depositor: "inj1depositoraddress...", + amounts: [ + { + denom: "inj", + amount: "100000000000000000000", + }, + ], + }, + // ...additional deposits + ], + pagination: { + nextKey: "", + total: 10, + }, + }, + }, + }, +]; + +export const getProposalVotesExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve votes for proposal ID 1 with pagination parameters.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Proposal votes retrieved successfully.", + action: "GET_PROPOSAL_VOTES", + content: { + votes: [ + { + proposalId: 1, + voter: "inj1voteraddress...", + options: [ + { + option: 1, + weight: "1.0", + }, + ], + metadata: "", + }, + // ...additional votes + ], + pagination: { + nextKey: "", + total: 100, + }, + }, + }, + }, +]; + +export const getProposalTallyExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve tally results for proposal ID 1.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Proposal tally retrieved successfully.", + action: "GET_PROPOSAL_TALLY", + content: { + yesCount: "100", + abstainCount: "10", + noCount: "5", + noWithVetoCount: "2", + }, + }, + }, +]; + +export const msgSubmitProposalExpiryFuturesMarketLaunchExample = [ + { + user: "{{user1}}", + content: { + text: "Submit an expiry futures market launch proposal titled 'Launch BTC-USDT Quarterly Futures'.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Expiry futures market launch proposal submitted successfully.", + action: "MSG_SUBMIT_PROPOSAL_EXPIRY_FUTURES_MARKET_LAUNCH", + content: { + txHash: "0xsubmitproposalexpiryfutureshash123def456ghi789jkl012mno345pqr678stu901vwx234yz", + success: true, + }, + }, + }, +]; + +export const msgSubmitProposalSpotMarketLaunchExample = [ + { + user: "{{user1}}", + content: { + text: "Submit a spot market launch proposal titled 'Launch INJ-USDT Spot Market'.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Spot market launch proposal submitted successfully.", + action: "MSG_SUBMIT_PROPOSAL_SPOT_MARKET_LAUNCH", + content: { + txHash: "0xsubmitproposalspotmarkethash123def456ghi789jkl012mno345pqr678stu901vwx234yz", + success: true, + }, + }, + }, +]; + +export const msgSubmitProposalPerpetualMarketLaunchExample = [ + { + user: "{{user1}}", + content: { + text: "Submit a perpetual market launch proposal titled 'Launch ETH-USDT Perpetual'.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Perpetual market launch proposal submitted successfully.", + action: "MSG_SUBMIT_PROPOSAL_PERPETUAL_MARKET_LAUNCH", + content: { + txHash: "0xsubmitproposalperpetualmarkethash123def456ghi789jkl012mno345pqr678stu901vwx234yz", + success: true, + }, + }, + }, +]; + +export const msgVoteExample = [ + { + user: "{{user1}}", + content: { + text: "Submit a vote for proposal ID 1 with option 1 and weight 1.0.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Vote submitted successfully.", + action: "MSG_VOTE", + content: { + txHash: "0xvotehash123def456ghi789jkl012mno345pqr678stu901vwx234yz", + success: true, + }, + }, + }, +]; + +export const msgSubmitTextProposalExample = [ + { + user: "{{user1}}", + content: { + text: "Submit a text proposal titled 'Community Pool Spend'.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Text proposal submitted successfully.", + action: "MSG_SUBMIT_TEXT_PROPOSAL", + content: { + txHash: "0xsubmittextproposalhash123def456ghi789jkl012mno345pqr678stu901vwx234yz", + success: true, + }, + }, + }, +]; + +export const msgSubmitProposalSpotMarketParamUpdateExample = [ + { + user: "{{user1}}", + content: { + text: "Submit a spot market parameter update proposal titled 'Update INJ-USDT Spot Market Parameters'.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Spot market parameter update proposal submitted successfully.", + action: "MSG_SUBMIT_PROPOSAL_SPOT_MARKET_PARAM_UPDATE", + content: { + txHash: "0xsubmitproposalspotmarketparamupdatehash123def456ghi789jkl012mno345pqr678stu901vwx234yz", + success: true, + }, + }, + }, +]; + +export const msgSubmitGenericProposalExample = [ + { + user: "{{user1}}", + content: { + text: "Submit a generic governance proposal titled 'Generic Proposal'.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Generic governance proposal submitted successfully.", + action: "MSG_SUBMIT_GENERIC_PROPOSAL", + content: { + txHash: "0xsubmitgenericproposalhash123def456ghi789jkl012mno345pqr678stu901vwx234yz", + success: true, + }, + }, + }, +]; + +export const msgGovDepositExample = [ + { + user: "{{user1}}", + content: { + text: "Deposit 100 INJ to proposal ID 1.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Deposit to proposal submitted successfully.", + action: "MSG_GOV_DEPOSIT", + content: { + txHash: "0xgovdeposithash123def456ghi789jkl012mno345pqr678stu901vwx234yz", + success: true, + }, + }, + }, +]; diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/examples/ibc.ts b/packages/plugin-injective/injective-sdk-client-ts/src/examples/ibc.ts new file mode 100644 index 00000000000..5c66323dbcd --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/examples/ibc.ts @@ -0,0 +1,102 @@ +export const getDenomTraceExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve the denomination trace for hash transfer/channel-0/uatom.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Denomination trace retrieved successfully.", + action: "GET_DENOM_TRACE", + content: { + denomTrace: { + path: "transfer/channel-0", + baseDenom: "uatom", + }, + }, + }, + }, +]; + +export const getDenomsTraceExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve all denomination traces with a limit of 100.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Denomination traces retrieved successfully.", + action: "GET_DENOMS_TRACE", + content: { + denomsTrace: [ + { + path: "transfer/channel-0", + baseDenom: "uatom", + }, + { + path: "transfer/channel-1", + baseDenom: "uosmo", + }, + // ...additional denom traces + ], + }, + }, + }, +]; + +export const getIBCTransferTxsExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve IBC transfer transactions sent by inj1senderaddress... to cosmos1receiveraddress... through source channel channel-0 and destination channel channel-1, limited to 10 results.", + }, + }, + { + user: "{{agent}}", + content: { + text: "IBC transfer transactions retrieved successfully.", + action: "GET_IBC_TRANSFER_TXS", + content: [ + { + sender: "inj1senderaddress...", + receiver: "cosmos1receiveraddress...", + eventNonce: 123, + eventHeight: 12345, + amount: "1000000000", + denom: "peggy0xabcdef...", + orchestratorAddress: "inj1orchestratoraddress...", + state: "completed", + txHashesList: [ + "0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890", + ], + }, + // ...additional IBC transfer transactions + ], + }, + }, +]; + +export const msgIBCTransferExample = [ + { + user: "{{user1}}", + content: { + text: "Perform an IBC transfer of 1,000,000,000 peggy0xabcdef... from inj1senderaddress... to cosmos1receiveraddress... via port transfer and channel channel-0 with a timeout of 300 seconds.", + }, + }, + { + user: "{{agent}}", + content: { + text: "IBC transfer submitted successfully.", + action: "MSG_IBC_TRANSFER", + content: { + txHash: "0xibctransferhash123def456ghi789jkl012mno345pqr678stu901vwx234yz", + success: true, + }, + }, + }, +]; diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/examples/insurance.ts b/packages/plugin-injective/injective-sdk-client-ts/src/examples/insurance.ts new file mode 100644 index 00000000000..9180eb017cf --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/examples/insurance.ts @@ -0,0 +1,210 @@ +// ======================================= +// Insurance Fund Module +// ======================================= + +export const getInsuranceModuleParamsExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve insurance module parameters, including the default redemption notice period duration.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Insurance module parameters retrieved successfully.", + action: "GET_INSURANCE_MODULE_PARAMS", + content: { + defaultRedemptionNoticePeriodDuration: 1209600, + }, + }, + }, +]; + +export const getInsuranceFundsExample = [ + { + user: "{{user1}}", + content: { + text: "Fetch all insurance funds.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Insurance funds retrieved successfully.", + action: "GET_INSURANCE_FUNDS", + content: { + insuranceFunds: [ + { + depositDenom: "inj", + insurancePoolTokenDenom: "share1", + redemptionNoticePeriodDuration: 1209600, + balance: "1000000000000000000", + totalShare: "1000000000000000000", + marketId: "0x1234abcd...", + marketTicker: "BTC/USDT", + oracleBase: "BTC", + oracleQuote: "USDT", + oracleType: 1, + expiry: 1640995200, + }, + { + depositDenom: "inj", + insurancePoolTokenDenom: "share2", + redemptionNoticePeriodDuration: 1209600, + balance: "500000000000000000", + totalShare: "500000000000000000", + marketId: "0x5678efgh...", + marketTicker: "ETH/USDT", + oracleBase: "ETH", + oracleQuote: "USDT", + oracleType: 1, + expiry: 1643587200, + }, + // ...additional insurance funds + ], + }, + }, + }, +]; + +export const getInsuranceFundExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve details for the insurance fund with market ID 0x1234abcd...", + }, + }, + { + user: "{{agent}}", + content: { + text: "Insurance fund details retrieved successfully.", + action: "GET_INSURANCE_FUND", + content: { + depositDenom: "inj", + insurancePoolTokenDenom: "share1", + redemptionNoticePeriodDuration: 1209600, + balance: "1000000000000000000", + totalShare: "1000000000000000000", + marketId: "0x1234abcd...", + marketTicker: "BTC/USDT", + oracleBase: "BTC", + oracleQuote: "USDT", + oracleType: 1, + expiry: 1640995200, + }, + }, + }, +]; + +export const getEstimatedRedemptionsExample = [ + { + user: "{{user1}}", + content: { + text: "Get estimated redemptions for market ID 0x1234abcd... and address inj1useraddress...", + }, + }, + { + user: "{{agent}}", + content: { + text: "Estimated redemptions retrieved successfully.", + action: "GET_ESTIMATED_REDEMPTIONS", + content: { + amounts: [ + { + amount: "1000000000000000000", + denom: "inj", + }, + { + amount: "500000000000000000", + denom: "share1", + }, + ], + }, + }, + }, +]; + +export const getPendingRedemptionsExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve pending redemptions for market ID 0x1234abcd... and address inj1useraddress...", + }, + }, + { + user: "{{agent}}", + content: { + text: "Pending redemptions retrieved successfully.", + action: "GET_PENDING_REDEMPTIONS", + content: { + amounts: [ + { + amount: "500000000000000000", + denom: "inj", + }, + ], + }, + }, + }, +]; + +export const msgCreateInsuranceFundExample = [ + { + user: "{{user1}}", + content: { + text: "Create a new insurance fund with market ID 0x1234abcd..., ticker 'BTC/USDT', and an initial deposit of 1,000,000,000 inj.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Insurance fund creation submitted successfully.", + action: "MSG_CREATE_INSURANCE_FUND", + content: { + txHash: "0xcreateinsurancefundhash123def456ghi789jkl012mno345pqr678stu901vwx234yz", + success: true, + }, + }, + }, +]; + +export const msgRequestRedemptionExample = [ + { + user: "{{user1}}", + content: { + text: "Request a redemption of 1,000,000,000 share1 from insurance fund with market ID 0x1234abcd...", + }, + }, + { + user: "{{agent}}", + content: { + text: "Redemption request submitted successfully.", + action: "MSG_REQUEST_REDEMPTION", + content: { + txHash: "0xrequestredemptionhash123def456ghi789jkl012mno345pqr678stu901vwx234yz", + success: true, + }, + }, + }, +]; + +export const msgUnderwriteExample = [ + { + user: "{{user1}}", + content: { + text: "Underwrite 1,000,000,000 inj to insurance fund with market ID 0x1234abcd...", + }, + }, + { + user: "{{agent}}", + content: { + text: "Underwriting submitted successfully.", + action: "MSG_UNDERWRITE", + content: { + txHash: "0xunderwritehash123def456ghi789jkl012mno345pqr678stu901vwx234yz", + success: true, + }, + }, + }, +]; diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/examples/mint.ts b/packages/plugin-injective/injective-sdk-client-ts/src/examples/mint.ts new file mode 100644 index 00000000000..6eb148c2682 --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/examples/mint.ts @@ -0,0 +1,65 @@ +// ======================================= +// Mint Module +// ======================================= + +export const getMintModuleParamsExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve mint module parameters, including mintDenom, inflationRateChange, inflationMax, inflationMin, goalBonded, and blocksPerYear.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Mint module parameters retrieved successfully.", + action: "GET_MINT_MODULE_PARAMS", + content: { + mintDenom: "inj", + inflationRateChange: "0.130000000000000000", + inflationMax: "0.200000000000000000", + inflationMin: "0.070000000000000000", + goalBonded: "0.670000000000000000", + blocksPerYear: "6311520", + }, + }, + }, +]; + +export const getInflationExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve the current inflation rate.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Current inflation rate retrieved successfully.", + action: "GET_INFLATION", + content: { + inflation: "0.130000000000000000", + }, + }, + }, +]; + +export const getAnnualProvisionsExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve the current annual provisions.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Annual provisions retrieved successfully.", + action: "GET_ANNUAL_PROVISIONS", + content: { + annualProvisions: "5000000000000000000000000", + }, + }, + }, +]; diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/examples/mito.ts b/packages/plugin-injective/injective-sdk-client-ts/src/examples/mito.ts new file mode 100644 index 00000000000..19105e266ef --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/examples/mito.ts @@ -0,0 +1,1232 @@ +// ======================================= +// Mito Module +// ======================================= + +export const getVaultExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve details for the vault with contract address inj1... and slug 'vault-slug'.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Vault details retrieved successfully.", + action: "GET_VAULT", + content: { + contractAddress: "inj1...", + codeId: "1", + vaultName: "Example Vault", + marketId: "0x123...", + currentTvl: 1000000, + profits: { + allTimeChange: 10.5, + threeMonthsChange: 5.2, + oneMonthChange: 2.1, + oneDayChange: 0.5, + oneWeekChange: 1.2, + oneYearChange: 15.3, + threeYearsChange: 45.6, + sixMonthsChange: 8.4, + }, + updatedAt: 1632150400, + vaultType: "perpetual", + lpTokenPrice: 1.05, + subaccountInfo: { + subaccountId: "0x123...", + balancesList: [ + { + denom: "inj", + totalBalance: "1000000000", + }, + ], + }, + masterContractAddress: "inj1...", + totalLpAmount: "1000000", + slug: "vault-slug", + createdAt: 1632150400, + notionalValueCap: "10000000", + tvlChanges: { + allTimeChange: 20.5, + }, + apy: 15.2, + apy7D: 14.8, + apy7DFq: 14.9, + apyue: 15.0, + apyV3: 15.1, + registrationMode: "open", + }, + }, + }, +]; + +export const getVaultsExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve the latest 10 vaults with code ID 1.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Vaults retrieved successfully.", + action: "GET_VAULTS", + content: { + vaults: [ + { + contractAddress: "inj1...", + vaultName: "Example Vault", + currentTvl: 1000000, + lpTokenPrice: 1.05, + apy: 15.2, + }, + { + contractAddress: "inj2...", + vaultName: "Another Vault", + currentTvl: 500000, + lpTokenPrice: 1.1, + apy: 14.5, + }, + // ...additional vaults + ], + pagination: { + total: 100, + }, + }, + }, + }, +]; + +export const getLpTokenPriceChartExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve LP token price chart for vault address inj1... from timestamp 1633360000 to 1640995200.", + }, + }, + { + user: "{{agent}}", + content: { + text: "LP token price chart retrieved successfully.", + action: "GET_LP_TOKEN_PRICE_CHART", + content: { + priceSnapshots: [ + { + price: 1.05, + updatedAt: 1633360000, + }, + { + price: 1.06, + updatedAt: 1633446400, + }, + // ...additional price snapshots + ], + }, + }, + }, +]; + +export const getTVLChartExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve TVL chart for vault address inj1... from timestamp 1633360000 to 1640995200.", + }, + }, + { + user: "{{agent}}", + content: { + text: "TVL chart retrieved successfully.", + action: "GET_TVL_CHART", + content: { + priceSnapshots: [ + { + price: 1000000, + updatedAt: 1633360000, + }, + { + price: 1005000, + updatedAt: 1633446400, + }, + // ...additional TVL snapshots + ], + }, + }, + }, +]; + +export const getVaultsByHolderAddressExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve vaults subscribed by holder address inj1... with vault address inj1..., skipping 0 and limiting to 10 records.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Vaults by holder address retrieved successfully.", + action: "GET_VAULTS_BY_HOLDER_ADDRESS", + content: { + subscriptions: [ + { + vaultInfo: { + contractAddress: "inj1...", + vaultName: "Example Vault", + currentTvl: 1000000, + }, + lpAmount: "1000000", + holderAddress: "inj1...", + lpAmountPercentage: 0.1, + }, + { + vaultInfo: { + contractAddress: "inj2...", + vaultName: "Another Vault", + currentTvl: 500000, + }, + lpAmount: "500000", + holderAddress: "inj1...", + lpAmountPercentage: 0.05, + }, + // ...additional subscriptions + ], + pagination: { + total: 100, + }, + }, + }, + }, +]; + +export const getLPHoldersExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve LP holders for vault address inj1... and staking contract address inj1..., skipping 0 and limiting to 10 records.", + }, + }, + { + user: "{{agent}}", + content: { + text: "LP holders retrieved successfully.", + action: "GET_LP_HOLDERS", + content: { + holders: [ + { + holderAddress: "inj1...", + vaultAddress: "inj1...", + amount: "1000000", + updatedAt: 1633360000, + lpAmountPercentage: 0.1, + redemptionLockTime: "1640995200", + stakedAmount: "500000", + }, + { + holderAddress: "inj2...", + vaultAddress: "inj1...", + amount: "500000", + updatedAt: 1633446400, + lpAmountPercentage: 0.05, + redemptionLockTime: "1643587200", + stakedAmount: "250000", + }, + // ...additional holders + ], + pagination: { + total: 100, + }, + }, + }, + }, +]; + +export const getHolderPortfolioExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve portfolio for holder address inj1... and staking contract address inj1....", + }, + }, + { + user: "{{agent}}", + content: { + text: "Holder portfolio retrieved successfully.", + action: "GET_HOLDER_PORTFOLIO", + content: { + totalValue: 1000000, + pnl: 50000, + totalValueChartList: [ + { + price: 1000000, + updatedAt: 1633360000, + }, + { + price: 1005000, + updatedAt: 1633446400, + }, + // ...additional total value snapshots + ], + pnlChartList: [ + { + price: 50000, + updatedAt: 1633360000, + }, + { + price: 50500, + updatedAt: 1633446400, + }, + // ...additional PnL snapshots + ], + updatedAt: 1633446400, + }, + }, + }, +]; + +export const getLeaderboardExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve leaderboard for epoch ID 1.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Leaderboard retrieved successfully.", + action: "GET_LEADERBOARD", + content: { + entries: [ + { + address: "inj1...", + accruedPoints: "100", + }, + { + address: "inj2...", + accruedPoints: "95", + }, + // ...additional leaderboard entries + ], + snapshotBlock: "1000000", + updatedAt: 1633360000, + rank: "1", + }, + }, + }, +]; + +export const getLeaderboardEpochsExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve leaderboard epochs with a limit of 10, from epoch ID 1 to 10.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Leaderboard epochs retrieved successfully.", + action: "GET_LEADERBOARD_EPOCHS", + content: { + epochs: [ + { + epochId: 1, + startAt: 1633360000, + endAt: 1640995200, + isLive: true, + }, + { + epochId: 2, + startAt: 1640995200, + endAt: 1643587200, + isLive: false, + }, + // ...additional epochs + ], + pagination: { + total: 10, + }, + }, + }, + }, +]; + +export const getTransferHistoryExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve transfer history for vault address inj1... and account address inj1..., skipping 0 and limiting to 10 records up to number 100.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Transfer history retrieved successfully.", + action: "GET_TRANSFER_HISTORY", + content: { + transfers: [ + { + lpAmount: "1000000", + coins: [ + { + denom: "inj", + amount: "1000000", + }, + ], + usdValue: "1000000", + isDeposit: true, + executedAt: 1633360000, + account: "inj1...", + vault: "inj1...", + txHash: "0x...", + tidByVault: 1, + tidByAccount: 1, + }, + { + lpAmount: "500000", + coins: [ + { + denom: "inj", + amount: "500000", + }, + ], + usdValue: "500000", + isDeposit: false, + executedAt: 1633446400, + account: "inj2...", + vault: "inj1...", + txHash: "0x...", + tidByVault: 2, + tidByAccount: 2, + }, + // ...additional transfer records + ], + pagination: { + total: 100, + }, + }, + }, + }, +]; + +export const getStakingPoolsExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve staking pools for staker address inj1... and staking contract address inj1..., skipping 0 and limiting to 10 records.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Staking pools retrieved successfully.", + action: "GET_STAKING_POOLS", + content: { + pools: [ + { + vaultName: "Example Vault", + vaultAddress: "inj1...", + stakeDenom: "inj", + gauges: [ + { + id: "1", + owner: "inj1...", + startTimestamp: 1633360000, + endTimestamp: 1640995200, + rewardTokens: [ + { + denom: "inj", + amount: "1000000", + }, + ], + lastDistribution: 1633360000, + status: "active", + }, + ], + apr: 15.2, + totalLiquidity: 1000000, + stakingAddress: "inj1...", + aprBreakdown: { + inj: 15.2, + }, + }, + { + vaultName: "Another Vault", + vaultAddress: "inj2...", + stakeDenom: "inj", + gauges: [ + { + id: "2", + owner: "inj2...", + startTimestamp: 1633446400, + endTimestamp: 1643587200, + rewardTokens: [ + { + denom: "inj", + amount: "500000", + }, + ], + lastDistribution: 1633446400, + status: "active", + }, + ], + apr: 14.5, + totalLiquidity: 500000, + stakingAddress: "inj2...", + aprBreakdown: { + inj: 14.5, + }, + }, + // ...additional staking pools + ], + pagination: { + total: 10, + }, + }, + }, + }, +]; + +export const getStakingHistoryExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve staking history for staker address inj1..., skipping 0 and limiting to 10 records up to number 100.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Staking history retrieved successfully.", + action: "GET_STAKING_HISTORY", + content: { + activities: [ + { + action: "stake", + txHash: "0x...", + staker: "inj1...", + vaultAddress: "inj1...", + numberByAccount: 1, + timestamp: 1633360000, + rewardedTokens: [ + { + denom: "inj", + amount: "1000000", + }, + ], + stakeAmount: { + denom: "inj", + amount: "1000000", + }, + }, + { + action: "unstake", + txHash: "0x...", + staker: "inj2...", + vaultAddress: "inj1...", + numberByAccount: 2, + timestamp: 1633446400, + rewardedTokens: [ + { + denom: "inj", + amount: "500000", + }, + ], + stakeAmount: { + denom: "inj", + amount: "500000", + }, + }, + // ...additional staking activities + ], + pagination: { + total: 100, + }, + }, + }, + }, +]; + +export const getStakingRewardsByAccountExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve staking rewards for staker address inj1... and staking contract address inj1....", + }, + }, + { + user: "{{agent}}", + content: { + text: "Staking rewards by account retrieved successfully.", + action: "GET_STAKING_REWARDS_BY_ACCOUNT", + content: { + rewards: [ + { + apr: 15.2, + vaultName: "Example Vault", + vaultAddress: "inj1...", + lockTimestamp: 1633360000, + claimableRewards: [ + { + denom: "inj", + amount: "1000000", + }, + ], + stakedAmount: { + denom: "inj", + amount: "1000000", + }, + lockedAmount: { + denom: "inj", + amount: "1000000", + }, + }, + { + apr: 14.5, + vaultName: "Another Vault", + vaultAddress: "inj2...", + lockTimestamp: 1633446400, + claimableRewards: [ + { + denom: "inj", + amount: "500000", + }, + ], + stakedAmount: { + denom: "inj", + amount: "500000", + }, + lockedAmount: { + denom: "inj", + amount: "500000", + }, + }, + // ...additional rewards + ], + pagination: { + total: 10, + }, + }, + }, + }, +]; + +export const getMissionsExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve missions for account address inj1....", + }, + }, + { + user: "{{agent}}", + content: { + text: "Missions retrieved successfully.", + action: "GET_MISSIONS", + content: { + missions: [ + { + id: "mission1", + points: "100", + completed: true, + accruedPoints: "50", + updatedAt: 1633360000, + progress: 0.5, + expected: 100, + }, + { + id: "mission2", + points: "200", + completed: false, + accruedPoints: "150", + updatedAt: 1633446400, + progress: 0.75, + expected: 200, + }, + // ...additional missions + ], + }, + }, + }, +]; + +export const getMissionLeaderboardExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve mission leaderboard for user address inj1....", + }, + }, + { + user: "{{agent}}", + content: { + text: "Mission leaderboard retrieved successfully.", + action: "GET_MISSION_LEADERBOARD", + content: { + entries: [ + { + address: "inj1...", + accruedPoints: "100", + }, + { + address: "inj2...", + accruedPoints: "95", + }, + // ...additional leaderboard entries + ], + updatedAt: 1633360000, + rank: "1", + }, + }, + }, +]; + +export const getIDOExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve IDO information for contract address inj1... and account address inj1....", + }, + }, + { + user: "{{agent}}", + content: { + text: "IDO information retrieved successfully.", + action: "GET_IDO", + content: { + ido: { + startTime: 1633360000, + endTime: 1640995200, + owner: "inj1...", + status: "active", + tokenInfo: { + denom: "inj", + supply: "1000000", + symbol: "INJ", + decimal: 18, + logoUrl: "https://example.com/logo.png", + }, + capPerAddress: "1000000", + contractAddress: "inj1...", + subscribedAmount: "500000", + projectTokenAmount: "1000000", + targetAmountInQuoteDenom: "1000000", + secondBeforeStartToSetQuotePrice: 3600, + targetAmountInUsd: "1000000", + tokenPrice: 1.0, + isAccountWhiteListed: true, + isLaunchWithVault: true, + isVestingScheduleEnabled: true, + name: "Example IDO", + progress: [ + { + status: "active", + timestamp: 1633360000, + }, + ], + quoteDenom: "inj", + stakeToSubscription: [ + { + stakedAmount: "1000000", + subscribableAmount: "500000", + }, + ], + useWhitelist: true, + marketId: "0x...", + vaultAddress: "inj1...", + }, + }, + }, + }, +]; + +export const getIDOsExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve all active IDOs with a limit of 10, up to IDO number 100, for account address inj1... and owner address inj1....", + }, + }, + { + user: "{{agent}}", + content: { + text: "IDOs retrieved successfully.", + action: "GET_IDOS", + content: { + idos: [ + { + startTime: 1633360000, + endTime: 1640995200, + owner: "inj1...", + status: "active", + contractAddress: "inj1...", + name: "Example IDO", + }, + { + startTime: 1633446400, + endTime: 1643587200, + owner: "inj2...", + status: "upcoming", + contractAddress: "inj2...", + name: "Another IDO", + }, + // ...additional IDOs + ], + pagination: { + total: 100, + }, + }, + }, + }, +]; + +export const getIDOSubscribersExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve subscribers for IDO with contract address inj1..., skipping 0 and limiting to 10 records sorted by subscribed amount.", + }, + }, + { + user: "{{agent}}", + content: { + text: "IDO subscribers retrieved successfully.", + action: "GET_IDO_SUBSCRIBERS", + content: { + idoAddress: "inj1...", + accounts: [ + { + accountAddress: "inj1...", + updatedAt: 1633360000, + weight: "1.0", + }, + { + accountAddress: "inj2...", + updatedAt: 1633446400, + weight: "0.8", + }, + // ...additional subscriber accounts + ], + pagination: { + total: 100, + }, + }, + }, + }, +]; + +export const getIDOSubscriptionExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve IDO subscription details for contract address inj1... and account address inj1....", + }, + }, + { + user: "{{agent}}", + content: { + text: "IDO subscription details retrieved successfully.", + action: "GET_IDO_SUBSCRIPTION", + content: { + subscription: { + maxSubscriptionCoin: { + denom: "inj", + amount: "1000000", + }, + committedAmount: "500000", + price: 1.0, + claimableCoins: [ + { + denom: "token", + amount: "500000", + }, + ], + rewardClaimed: false, + tokenInfo: { + denom: "inj", + supply: "1000000", + symbol: "INJ", + decimal: 18, + logoUrl: "https://example.com/logo.png", + }, + quoteDenom: "inj", + updatedAt: 1633360000, + stakedAmount: "1000000", + marketId: "0x...", + }, + }, + }, + }, +]; + +export const getIDOActivitiesExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve IDO activities for contract address inj1..., account address inj1..., skipping 0 and limiting to 10 records up to number 100.", + }, + }, + { + user: "{{agent}}", + content: { + text: "IDO activities retrieved successfully.", + action: "GET_IDO_ACTIVITIES", + content: { + activities: [ + { + address: "inj1...", + subscribedCoin: { + denom: "inj", + amount: "1000000", + }, + usdValue: 1000000, + timestamp: 1633360000, + txHash: "0x...", + }, + { + address: "inj2...", + subscribedCoin: { + denom: "inj", + amount: "500000", + }, + usdValue: 500000, + timestamp: 1633446400, + txHash: "0x...", + }, + // ...additional activities + ], + pagination: { + total: 100, + }, + }, + }, + }, +]; + +export const getIDOWhitelistExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve IDO whitelist for contract address inj1..., skipping 0 and limiting to 10 records.", + }, + }, + { + user: "{{agent}}", + content: { + text: "IDO whitelist retrieved successfully.", + action: "GET_IDO_WHITELIST", + content: { + idoAddress: "inj1...", + accounts: [ + { + accountAddress: "inj1...", + updatedAt: 1633360000, + weight: "1.0", + }, + { + accountAddress: "inj2...", + updatedAt: 1633446400, + weight: "0.8", + }, + // ...additional whitelist accounts + ], + pagination: { + total: 100, + }, + }, + }, + }, +]; + +export const getClaimReferencesExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve claim references for IDO with contract address inj1... and account address inj1..., skipping 0 and limiting to 10 records up to number 100.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Claim references retrieved successfully.", + action: "GET_CLAIM_REFERENCES", + content: { + claimReferences: [ + { + denom: "inj", + updatedAt: 1633360000, + claimedAmount: "500000", + claimableAmount: "1000000", + accountAddress: "inj1...", + cwContractAddress: "inj1...", + idoContractAddress: "inj1...", + startVestingTime: 1633360000, + vestingDurationSeconds: 2592000, + }, + { + denom: "token", + updatedAt: 1633446400, + claimedAmount: "300000", + claimableAmount: "700000", + accountAddress: "inj2...", + cwContractAddress: "inj2...", + idoContractAddress: "inj2...", + startVestingTime: 1633446400, + vestingDurationSeconds: 2592000, + }, + // ...additional claim references + ], + pagination: { + total: 100, + }, + }, + }, + }, +]; + +//Mito execute messages examples + +export const getLaunchpadSubscribeExample = [ + { + user: "{{user1}}", + content: { + text: "Subscribe to launchpad with 1000 INJ tokens.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Launchpad subscription processed successfully.", + action: "LAUNCHPAD_SUBSCRIBE", + content: { + amount: 1000, + quoteTokenDenom: "inj", + quoteTokenDecimals: 18, + contractAddress: "inj1...", + }, + }, + }, +]; + +export const getSubscribeVaultExample = [ + { + user: "{{user1}}", + content: { + text: "Subscribe to vault with 1.5 INJ and 1000 USDT.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Vault subscription processed successfully.", + action: "SUBSCRIBE_VAULT", + content: { + market: { + baseDenom: "inj", + baseDecimals: 18, + quoteDecimals: 6, + quoteDenom: "usdt", + }, + baseAmount: 1.5, + quoteAmount: 1000, + subscriptionType: "BaseOnly", + vaultDetails: { + vaultSubaccountId: "0x...", + vaultMasterAddress: "inj1...", + vaultType: "crates.io:vault-cpmm-spot", + }, + slippage: { + max_penalty: "0.1", + }, + }, + }, + }, +]; + +export const getInstantiateCPMMVaultExample = [ + { + user: "{{user1}}", + content: { + text: "Create a new CPMM vault for INJ/USDT trading pair.", + }, + }, + { + user: "{{agent}}", + content: { + text: "CPMM vault instantiated successfully.", + action: "INSTANTIATE_CPMM_VAULT", + content: { + MITO_MASTER_CONTRACT_ADDRESS: "inj1...", + CPMM_CONTRACT_CODE: 123, + senderWalletAddress: "inj1...", + marketId: "0x...", + feeBps: 30, + baseDecimals: 18, + quoteDecimals: 6, + funds: [ + { + denom: "inj", + amount: "1000000000000000000", + }, + ], + notionalValueCap: "1000000", + pricingStrategy: { + SmoothingPricingWithRelativePriceRange: { + bid_range: "0.01", + ask_range: "0.01", + }, + }, + maxInvariantSensitivityBps: "100", + maxPriceSensitivityBps: "100", + orderType: "LIMIT", + }, + }, + }, +]; + +export const getLaunchpadClaimExample = [ + { + user: "{{user1}}", + content: { + text: "Claim tokens from launchpad contract.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Launchpad tokens claimed successfully.", + action: "LAUNCHPAD_CLAIM", + content: { + contractAddress: "inj1...", + }, + }, + }, +]; + +export const getVaultSubscribeExample = [ + { + user: "{{user1}}", + content: { + text: "Subscribe to a spot trading vault with INJ/USDT.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Vault subscription processed successfully.", + action: "VAULT_SUBSCRIBE", + content: { + vaultType: "crates.io:vault-cpmm-spot", + slippage: { + max_penalty: "0.1", + }, + vaultSubaccountId: "0x...", + baseAmount: 1.5, + quoteAmount: 1000, + market: { + baseDenom: "inj", + baseDecimals: 18, + quoteDenom: "usdt", + quoteDecimals: 6, + }, + subscriptionType: "BaseOnly", + masterAddress: "inj1...", + }, + }, + }, +]; + +export const getRedeemFromVaultExample = [ + { + user: "{{user1}}", + content: { + text: "Redeem 0.01 LP tokens from the vault.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Vault redemption processed successfully.", + action: "REDEEM_FROM_VAULT", + content: { + vaultSubaccountId: "0x...", + redeemAmount: 0.01, + vaultBaseDecimals: 18, + masterAddress: "inj1...", + vaultLpDenom: "factory/...", + marketType: "Spot", + redemptionType: "BaseOnly", + slippage: { + max_penalty: "0.1", + }, + }, + }, + }, +]; + +export const getStakeVaultLPExample = [ + { + user: "{{user1}}", + content: { + text: "Stake 0.01 LP tokens in the vault.", + }, + }, + { + user: "{{agent}}", + content: { + text: "LP tokens staked successfully.", + action: "STAKE_VAULT_LP", + content: { + amount: 0.01, + vaultLpDenom: "factory/...", + vaultTokenDecimals: 18, + stakingContractAddress: "inj1...", + }, + }, + }, +]; + +export const getUnstakeVaultLPExample = [ + { + user: "{{user1}}", + content: { + text: "Unstake 0.01 LP tokens from the vault.", + }, + }, + { + user: "{{agent}}", + content: { + text: "LP tokens unstaked successfully.", + action: "UNSTAKE_VAULT_LP", + content: { + amount: 0.01, + vaultLpDenom: "factory/...", + vaultTokenDecimals: 18, + stakingContractAddress: "inj1...", + }, + }, + }, +]; + +export const getClaimVaultRewardsExample = [ + { + user: "{{user1}}", + content: { + text: "Claim staking rewards from the vault.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Vault rewards claimed successfully.", + action: "CLAIM_VAULT_REWARDS", + content: { + vaultLpDenom: "factory/...", + stakingContractAddress: "inj1...", + }, + }, + }, +]; diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/examples/peggy.ts b/packages/plugin-injective/injective-sdk-client-ts/src/examples/peggy.ts new file mode 100644 index 00000000000..b2dd09a2c0b --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/examples/peggy.ts @@ -0,0 +1,63 @@ +// ======================================= +// Peggy Module +// ======================================= + +export const getPeggyModuleParamsExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve Peggy module parameters, including bridgeChainId, peggyId, signedValsetsWindow, signedBatchesWindow, signedClaimsWindow, targetBatchTimeout, averageBlockTime, averageEthereumBlockTime, slash fractions, unbondSlashingValsetsWindow, bridgeContractAddress, bridgeActive status, and oracles.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Peggy module parameters retrieved successfully.", + action: "GET_PEGGY_MODULE_PARAMS", + content: { + bridgeParams: { + bridgeChainId: "1", + peggyId: "peggy1", + signedValsetsWindow: "10000", + signedBatchesWindow: "10000", + signedClaimsWindow: "10000", + targetBatchTimeout: "43200000", + averageBlockTime: "5000", + averageEthereumBlockTime: "15000", + slashFractionValset: "0.001", + slashFractionBatch: "0.001", + slashFractionClaim: "0.001", + slashFractionConflictingClaim: "0.001", + unbondSlashingValsetsWindow: "10000", + bridgeContractAddress: "0xBridgeContractAddress...", + bridgeActive: true, + oracles: [ + "0xOracleAddress1...", + "0xOracleAddress2...", + // ...additional oracle addresses + ], + }, + }, + }, + }, +]; + +export const msgSendToEthExample = [ + { + user: "{{user1}}", + content: { + text: "Send 1,000,000,000 inj with a bridge fee of 1,000,000 inj to Ethereum address 0xEthereumAddress...", + }, + }, + { + user: "{{agent}}", + content: { + text: "Tokens sent to Ethereum successfully.", + action: "MSG_SEND_TO_ETH", + content: { + txHash: "0xibctransferhash123def456ghi789jkl012mno345pqr678stu901vwx234yz", + success: true, + }, + }, + }, +]; diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/examples/permissions.ts b/packages/plugin-injective/injective-sdk-client-ts/src/examples/permissions.ts new file mode 100644 index 00000000000..bec41a88c99 --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/examples/permissions.ts @@ -0,0 +1,209 @@ +// ======================================= +// Permission Module +// ======================================= + +export const getAddressesByRoleExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve all addresses with the role 'minter' for denomination 'peggy0x...'.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Addresses with role 'minter' retrieved successfully.", + action: "GET_ADDRESSES_BY_ROLE", + content: { + addresses: [ + "inj1address1...", + "inj1address2...", + "inj1address3...", + ], + }, + }, + }, +]; + +export const getAddressRolesExample = [ + { + user: "{{user1}}", + content: { + text: "Fetch roles for address 'inj1address1...' and denomination 'peggy0x...'.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Roles for address 'inj1address1...' retrieved successfully.", + action: "GET_ADDRESS_ROLES", + content: { + roles: ["minter", "burner"], + }, + }, + }, +]; + +export const getAllNamespacesExample = [ + { + user: "{{user1}}", + content: { + text: "Fetch all namespaces.", + }, + }, + { + user: "{{agent}}", + content: { + text: "All namespaces retrieved successfully.", + action: "GET_ALL_NAMESPACES", + content: { + namespaces: [ + { + denom: "peggy0x...", + wasmHook: "inj1hookaddress...", + mintsPaused: false, + sendsPaused: false, + burnsPaused: false, + rolePermissions: [ + { + role: "minter", + permissions: 1, + }, + { + role: "burner", + permissions: 2, + }, + ], + addressRoles: [ + { + address: "inj1address1...", + roles: ["minter"], + }, + { + address: "inj1address2...", + roles: ["burner"], + }, + ], + }, + { + denom: "peggy0xabc...", + wasmHook: "inj1anotherhook...", + mintsPaused: true, + sendsPaused: false, + burnsPaused: true, + rolePermissions: [ + { + role: "minter", + permissions: 1, + }, + ], + addressRoles: [ + { + address: "inj1address3...", + roles: ["minter"], + }, + ], + }, + // ...additional namespaces + ], + }, + }, + }, +]; + +export const getPermissionsModuleParamsExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve Peggy module parameters, including bridge settings and oracle addresses.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Peggy module parameters retrieved successfully.", + action: "GET_PERMISSIONS_MODULE_PARAMS", + content: { + wasmHookQueryMaxGas: "1000000", + }, + }, + }, +]; + +export const getNamespaceByDenomExample = [ + { + user: "{{user1}}", + content: { + text: "Fetch namespace details for denomination 'peggy0x...' and include role information.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Namespace details retrieved successfully.", + action: "GET_NAMESPACE_BY_DENOM", + content: { + namespace: { + denom: "peggy0x...", + wasmHook: "inj1hookaddress...", + mintsPaused: false, + sendsPaused: false, + burnsPaused: false, + rolePermissions: [ + { + role: "minter", + permissions: 1, + }, + ], + addressRoles: [ + { + address: "inj1address1...", + roles: ["minter"], + }, + ], + }, + }, + }, + }, +]; + +export const getVouchersForAddressExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve vouchers for address 'inj1address1...'.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Vouchers for address 'inj1address1...' retrieved successfully.", + action: "GET_VOUCHERS_FOR_ADDRESS", + content: { + vouchers: [ + { + coins: [ + { + amount: "1000000000000000000", + denom: "peggy0x...", + }, + { + amount: "500000000000000000", + denom: "peggy0xabc...", + }, + ], + }, + { + coins: [ + { + amount: "2000000000000000000", + denom: "peggy0xdef...", + }, + ], + }, + // ...additional vouchers + ], + }, + }, + }, +]; diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/examples/staking.ts b/packages/plugin-injective/injective-sdk-client-ts/src/examples/staking.ts new file mode 100644 index 00000000000..c33199f0c08 --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/examples/staking.ts @@ -0,0 +1,726 @@ +// ======================================= +// Staking Module +// ======================================= + +export const getStakingModuleParamsExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve staking module parameters including unbonding time, max validators, max entries, historical entries, and bond denomination.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Staking module parameters retrieved successfully.", + action: "GET_STAKING_MODULE_PARAMS", + content: { + unbondingTime: 1209600, + maxValidators: 100, + maxEntries: 7, + historicalEntries: 10000, + bondDenom: "inj", + }, + }, + }, +]; + +export const getPoolExample = [ + { + user: "{{user1}}", + content: { + text: "Fetch staking pool information.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Staking pool information retrieved successfully.", + action: "GET_POOL", + content: { + notBondedTokens: "1000000000000000000", + bondedTokens: "5000000000000000000", + }, + }, + }, +]; + +export const getValidatorsExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve validators with pagination key 'abc123...', offset 0, limit 100, and count total.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Validators retrieved successfully.", + action: "GET_VALIDATORS", + content: { + validators: [ + { + operatorAddress: "injvaloper1...", + consensusPubkey: "injvalconspub1...", + jailed: false, + status: 2, + tokens: "1000000", + delegatorShares: "1000000.000000000000000000", + description: { + moniker: "Validator One", + identity: "", + website: "https://validatorone.com", + securityContact: "security@validatorone.com", + details: "Leading validator in the network.", + }, + unbondingHeight: "0", + unbondingTime: "0", + commission: { + commissionRates: { + rate: "0.100000000000000000", + maxRate: "0.200000000000000000", + maxChangeRate: "0.010000000000000000", + }, + updateTime: "0", + }, + minSelfDelegation: "1000000", + }, + // ...additional validators + ], + pagination: { + nextKey: "def456...", + total: "100", + }, + }, + }, + }, +]; + +export const getValidatorExample = [ + { + user: "{{user1}}", + content: { + text: "Fetch details for validator with address 'injvaloper1...'.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Validator details retrieved successfully.", + action: "GET_VALIDATOR", + content: { + operatorAddress: "injvaloper1...", + consensusPubkey: "injvalconspub1...", + jailed: false, + status: 2, + tokens: "1000000", + delegatorShares: "1000000.000000000000000000", + description: { + moniker: "Validator One", + identity: "", + website: "https://validatorone.com", + securityContact: "security@validatorone.com", + details: "Leading validator in the network.", + }, + unbondingHeight: "0", + unbondingTime: "0", + commission: { + commissionRates: { + rate: "0.100000000000000000", + maxRate: "0.200000000000000000", + maxChangeRate: "0.010000000000000000", + }, + updateTime: "0", + }, + minSelfDelegation: "1000000", + }, + }, + }, +]; + +export const getValidatorDelegationsExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve delegations for validator 'injvaloper1...' with pagination key 'abc123...', offset 0, limit 100, and count total.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Validator delegations retrieved successfully.", + action: "GET_VALIDATOR_DELEGATIONS", + content: { + delegations: [ + { + delegation: { + delegatorAddress: "inj1delegator1...", + validatorAddress: "injvaloper1...", + shares: "1000000.000000000000000000", + }, + balance: { + denom: "inj", + amount: "1000000000000000000", + }, + }, + // ...additional delegations + ], + pagination: { + nextKey: "ghi789...", + total: "50", + }, + }, + }, + }, +]; + +export const getValidatorDelegationsNoThrowExample = [ + { + user: "{{user1}}", + content: { + text: "Safely retrieve delegations for validator 'injvaloper1...' with pagination key 'abc123...', offset 0, limit 100, and count total.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Validator delegations retrieved successfully (no-throw).", + action: "GET_VALIDATOR_DELEGATIONS_NO_THROW", + content: { + delegations: [ + { + delegation: { + delegatorAddress: "inj1delegator1...", + validatorAddress: "injvaloper1...", + shares: "1000000.000000000000000000", + }, + balance: { + denom: "inj", + amount: "1000000000000000000", + }, + }, + // ...additional delegations + ], + pagination: { + nextKey: "ghi789...", + total: "50", + }, + }, + }, + }, +]; + +export const getValidatorUnbondingDelegationsExample = [ + { + user: "{{user1}}", + content: { + text: "Fetch unbonding delegations for validator 'injvaloper1...' with pagination key 'abc123...', offset 0, limit 100, and count total.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Validator unbonding delegations retrieved successfully.", + action: "GET_VALIDATOR_UNBONDING_DELEGATIONS", + content: { + unbondingDelegations: [ + { + delegatorAddress: "inj1...", + validatorAddress: "injvaloper1...", + entries: [ + { + creationHeight: "1000000", + completionTime: "1633446400", + initialBalance: "1000000000000000000", + balance: "1000000000000000000", + }, + ], + }, + // ...additional unbonding delegations + ], + pagination: { + nextKey: "jkl012...", + total: "20", + }, + }, + }, + }, +]; + +export const getValidatorUnbondingDelegationsNoThrowExample = [ + { + user: "{{user1}}", + content: { + text: "Safely fetch unbonding delegations for validator 'injvaloper1...' with pagination key 'abc123...', offset 0, limit 100, and count total.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Validator unbonding delegations retrieved successfully (no-throw).", + action: "GET_VALIDATOR_UNBONDING_DELEGATIONS_NO_THROW", + content: { + unbondingDelegations: [ + { + delegatorAddress: "inj1...", + validatorAddress: "injvaloper1...", + entries: [ + { + creationHeight: "1000000", + completionTime: "1633446400", + initialBalance: "1000000000000000000", + balance: "1000000000000000000", + }, + ], + }, + // ...additional unbonding delegations + ], + pagination: { + nextKey: "jkl012...", + total: "20", + }, + }, + }, + }, +]; + +export const getDelegationsExample = [ + { + user: "{{user1}}", + content: { + text: "Fetch all delegations for delegator address 'inj1...' with pagination key 'abc123...', offset 0, limit 100, and count total.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Delegations retrieved successfully.", + action: "GET_DELEGATIONS", + content: { + delegations: [ + { + delegation: { + delegatorAddress: "inj1...", + validatorAddress: "injvaloper1...", + shares: "1000000.000000000000000000", + }, + balance: { + denom: "inj", + amount: "1000000000000000000", + }, + }, + // ...additional delegations + ], + pagination: { + nextKey: "mno345...", + total: "100", + }, + }, + }, + }, +]; + +export const getDelegationsNoThrowExample = [ + { + user: "{{user1}}", + content: { + text: "Safely fetch all delegations for delegator address 'inj1...' with pagination key 'abc123...', offset 0, limit 100, and count total.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Delegations retrieved successfully (no-throw).", + action: "GET_DELEGATIONS_NO_THROW", + content: { + delegations: [ + { + delegation: { + delegatorAddress: "inj1...", + validatorAddress: "injvaloper1...", + shares: "1000000.000000000000000000", + }, + balance: { + denom: "inj", + amount: "1000000000000000000", + }, + }, + // ...additional delegations + ], + pagination: { + nextKey: "mno345...", + total: "100", + }, + }, + }, + }, +]; + +export const getUnbondingDelegationsExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve unbonding delegations for delegator address 'inj1...' with pagination key 'abc123...', offset 0, limit 100, and count total.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Unbonding delegations retrieved successfully.", + action: "GET_UNBONDING_DELEGATIONS", + content: { + unbondingDelegations: [ + { + delegatorAddress: "inj1...", + validatorAddress: "injvaloper1...", + entries: [ + { + creationHeight: "1000000", + completionTime: "1633446400", + initialBalance: "1000000000000000000", + balance: "1000000000000000000", + }, + ], + }, + // ...additional unbonding delegations + ], + pagination: { + nextKey: "ghi789...", + total: "30", + }, + }, + }, + }, +]; + +export const getReDelegationsExample = [ + { + user: "{{user1}}", + content: { + text: "Fetch redelegations for delegator address 'inj1...' with pagination key 'abc123...', offset 0, limit 100, and count total.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Redelegations retrieved successfully.", + action: "GET_REDELEGATIONS", + content: { + redelegations: [ + { + delegatorAddress: "inj1...", + validatorSrcAddress: "injvaloper1...", + validatorDstAddress: "injvaloper2...", + entries: [ + { + creationHeight: "1000000", + completionTime: "1633446400", + initialBalance: "500000000000000000", + sharesDst: "500000.000000000000000000", + }, + ], + }, + // ...additional redelegations + ], + pagination: { + nextKey: "stu901...", + total: "40", + }, + }, + }, + }, +]; + +export const msgCreateValidatorExample = [ + { + user: "{{user1}}", + content: { + text: "Create a new validator with moniker 'Validator One', identity 'keybase-id', website 'https://validatorone.com', security contact 'security@validatorone.com', details 'Leading validator in the network.', commission rate 0.10, max rate 0.20, max change rate 0.01, minimum self-delegation of 1000000000000000000 inj, delegator address 'inj1...', validator address 'injvaloper1...', public key 'injvalconspub1...', and initial self-delegation of 1000000000000000000 inj.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Validator creation submitted successfully.", + action: "MSG_CREATE_VALIDATOR", + content: { + txHash: "0xcreatevalidatorhash123def456ghi789jkl012mno345pqr678stu901vwx234yz", + success: true, + }, + }, + }, +]; + +export const msgEditValidatorExample = [ + { + user: "{{user1}}", + content: { + text: "Edit validator 'injvaloper1...' with new moniker 'Validator One Updated', new identity 'new-keybase-id', new website 'https://new-validatorone.com', new security contact 'newsecurity@validatorone.com', new details 'Updated details.', new commission rate 0.15, and new minimum self-delegation of 2000000000000000000 inj.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Validator edited successfully.", + action: "MSG_EDIT_VALIDATOR", + content: { + txHash: "0xeditvalidatorhash123def456ghi789jkl012mno345pqr678stu901vwx234yz", + success: true, + }, + }, + }, +]; + +export const msgDelegateExample = [ + { + user: "{{user1}}", + content: { + text: "Delegate 1000000000000000000 inj from delegator address 'inj1...' to validator address 'injvaloper1...'.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Delegation submitted successfully.", + action: "MSG_DELEGATE", + content: { + txHash: "0xdelegationhash123def456ghi789jkl012mno345pqr678stu901vwx234yz", + success: true, + }, + }, + }, +]; + +export const msgBeginRedelegateExample = [ + { + user: "{{user1}}", + content: { + text: "Begin redelegating 1000000000000000000 inj from validator 'injvaloper1...' to validator 'injvaloper2...'.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Redelegation submitted successfully.", + action: "MSG_BEGIN_REDELEGATE", + content: { + txHash: "0xredelegationhash123def456ghi789jkl012mno345pqr678stu901vwx234yz", + success: true, + }, + }, + }, +]; + +export const msgUndelegateExample = [ + { + user: "{{user1}}", + content: { + text: "Undelegate 1000000000000000000 inj from delegator address 'inj1...' to validator address 'injvaloper1...'.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Undelegation submitted successfully.", + action: "MSG_UNDELEGATE", + content: { + txHash: "0xundelegationhash123def456ghi789jkl012mno345pqr678stu901vwx234yz", + success: true, + }, + }, + }, +]; + +export const msgCancelUnbondingDelegationExample = [ + { + user: "{{user1}}", + content: { + text: "Cancel undelegation of 1000000000000000000 inj from delegator address 'inj1...' to validator address 'injvaloper1...' initiated at height 1000000.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Unbonding delegation cancellation submitted successfully.", + action: "MSG_CANCEL_UNBONDING_DELEGATION", + content: { + txHash: "0xcancelundelegationhash123def456ghi789jkl012mno345pqr678stu901vwx234yz", + success: true, + }, + }, + }, +]; + +export const getDelegationExample = [ + { + user: "{{user1}}", + content: { + text: "Fetch delegation details for delegator address 'inj1...' and validator address 'injvaloper1...'.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Delegation details retrieved successfully.", + action: "GET_DELEGATION", + content: { + delegation: { + delegatorAddress: "inj1...", + validatorAddress: "injvaloper1...", + shares: "1000000000000000000", + }, + balance: { + denom: "inj", + amount: "1000000000000000000", + }, + }, + }, + }, +]; + +export const getDelegatorsExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve all delegators for validator 'injvaloper1...' with pagination key 'abc123...', offset 0, limit 100, and count total.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Delegators retrieved successfully.", + action: "GET_DELEGATORS", + content: { + delegators: [ + { + delegation: { + delegatorAddress: "inj1delegator1...", + validatorAddress: "injvaloper1...", + shares: "1000000.000000000000000000", + }, + balance: { + denom: "inj", + amount: "1000000000000000000", + }, + }, + // ...additional delegators + ], + pagination: { + nextKey: "def456...", + total: "50", + }, + }, + }, + }, +]; + +export const getDelegatorsNoThrowExample = [ + { + user: "{{user1}}", + content: { + text: "Safely retrieve all delegators for validator 'injvaloper1...' with pagination key 'abc123...', offset 0, limit 100, and count total.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Delegators retrieved successfully (no-throw).", + action: "GET_DELEGATORS_NO_THROW", + content: { + delegators: [ + { + delegation: { + delegatorAddress: "inj1delegator1...", + validatorAddress: "injvaloper1...", + shares: "1000000.000000000000000000", + }, + balance: { + denom: "inj", + amount: "1000000000000000000", + }, + }, + // ...additional delegators + ], + pagination: { + nextKey: "def456...", + total: "50", + }, + }, + }, + }, +]; + +export const getUnbondingDelegationsNoThrowExample = [ + { + user: "{{user1}}", + content: { + text: "Safely retrieve unbonding delegations for delegator address 'inj1...' with pagination key 'abc123...', offset 0, limit 100, and count total.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Unbonding delegations retrieved successfully (no-throw).", + action: "GET_UNBONDING_DELEGATIONS_NO_THROW", + content: { + unbondingDelegations: [ + { + delegatorAddress: "inj1...", + validatorAddress: "injvaloper1...", + entries: [ + { + creationHeight: "1000000", + completionTime: "1633446400", + initialBalance: "1000000000000000000", + balance: "1000000000000000000", + }, + ], + }, + // ...additional unbonding delegations + ], + pagination: { + nextKey: "ghi789...", + total: "30", + }, + }, + }, + }, +]; + +export const getReDelegationsNoThrowExample = [ + { + user: "{{user1}}", + content: { + text: "Safely fetch redelegations for delegator address 'inj1...' with pagination key 'abc123...', offset 0, limit 100, and count total.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Redelegations retrieved successfully (no-throw).", + action: "GET_REDELEGATIONS_NO_THROW", + content: { + redelegations: [ + { + delegatorAddress: "inj1...", + validatorSrcAddress: "injvaloper1...", + validatorDstAddress: "injvaloper2...", + entries: [ + { + creationHeight: "1000000", + completionTime: "1633446400", + initialBalance: "500000000000000000", + sharesDst: "500000.000000000000000000", + }, + ], + }, + // ...additional redelegations + ], + pagination: { + nextKey: "stu901...", + total: "40", + }, + }, + }, + }, +]; diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/examples/token-factory.ts b/packages/plugin-injective/injective-sdk-client-ts/src/examples/token-factory.ts new file mode 100644 index 00000000000..fa95fd9bf78 --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/examples/token-factory.ts @@ -0,0 +1,192 @@ +// ======================================= +// Token Factory Module +// ======================================= + +export const getDenomsFromCreatorExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve all denominations created by creator address 'inj1creator...'.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Denominations created by 'inj1creator...' retrieved successfully.", + action: "GET_DENOMS_FROM_CREATOR", + content: { + denoms: [ + "peggy0xabc...", + "peggy0xdef...", + "peggy0xghi...", + // ...additional denominations + ], + }, + }, + }, +]; + +export const getDenomAuthorityMetadataExample = [ + { + user: "{{user1}}", + content: { + text: "Fetch authority metadata for denomination 'peggy0xabc...' created by 'inj1creator...'.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Authority metadata for denomination 'peggy0xabc...' retrieved successfully.", + action: "GET_DENOM_AUTHORITY_METADATA", + content: { + authorityMetadata: { + admin: "inj1admin...", + mintRestricted: false, + burnRestricted: true, + }, + }, + }, + }, +]; + +export const getTokenFactoryModuleParamsExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve Token Factory module parameters.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Token Factory module parameters retrieved successfully.", + action: "GET_TOKEN_FACTORY_MODULE_PARAMS", + content: { + mintDenom: "inj", + mintDenomMinAmount: "1000", + mintDenomMaxAmount: "1000000", + }, + }, + }, +]; + +export const getTokenFactoryModuleStateExample = [ + { + user: "{{user1}}", + content: { + text: "Fetch current state of the Token Factory module.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Token Factory module state retrieved successfully.", + action: "GET_TOKEN_FACTORY_MODULE_STATE", + content: { + totalDenoms: 150, + activeDenoms: 145, + pausedDenoms: 5, + }, + }, + }, +]; + +export const msgBurnExample = [ + { + user: "{{user1}}", + content: { + text: "Burn 5000000 peggy0xabc... from sender address 'inj1sender...'.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Burn transaction submitted successfully.", + action: "MSG_BURN", + content: { + txHash: "0xburntxhash123def456ghi789jkl012mno345pqr678stu901vwx234yz", + success: true, + }, + }, + }, +]; + +export const msgChangeAdminExample = [ + { + user: "{{user1}}", + content: { + text: "Change admin of denomination 'peggy0xabc...' to new admin address 'inj1newadmin...'.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Admin change for denomination 'peggy0xabc...' submitted successfully.", + action: "MSG_CHANGE_ADMIN", + content: { + txHash: "0xchangeadminhash123def456ghi789jkl012mno345pqr678stu901vwx234yz", + success: true, + }, + }, + }, +]; + +export const msgCreateDenomExample = [ + { + user: "{{user1}}", + content: { + text: "Create a new denomination 'peggy0xjkl...' with sub-denomination 'subdenom'.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Denomination 'peggy0xjkl...' created successfully.", + action: "MSG_CREATE_DENOM", + content: { + txHash: "0xcreatedenomhash123def456ghi789jkl012mno345pqr678stu901vwx234yz", + success: true, + }, + }, + }, +]; + +export const msgMintExample = [ + { + user: "{{user1}}", + content: { + text: "Mint 10000000 peggy0xabc... to creator address 'inj1creator...'.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Mint transaction submitted successfully.", + action: "MSG_MINT", + content: { + txHash: "0xminttxhash123def456ghi789jkl012mno345pqr678stu901vwx234yz", + success: true, + }, + }, + }, +]; + +export const msgSetDenomMetadataExample = [ + { + user: "{{user1}}", + content: { + text: "Set metadata for denomination 'peggy0xabc...' with name 'Peggy Token', symbol 'PEG', description 'Peggy token description', and display denomination 'peg'.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Denomination metadata for 'peggy0xabc...' set successfully.", + action: "MSG_SET_DENOM_METADATA", + content: { + txHash: "0xsetmetadatahash123def456ghi789jkl012mno345pqr678stu901vwx234yz", + success: true, + }, + }, + }, +]; diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/examples/wasm.ts b/packages/plugin-injective/injective-sdk-client-ts/src/examples/wasm.ts new file mode 100644 index 00000000000..02284db33ba --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/examples/wasm.ts @@ -0,0 +1,608 @@ +// ======================================= +// WASM and WasmX Module +// ======================================= + +export const getWasmxModuleParamsExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve WasmX module parameters.", + }, + }, + { + user: "{{agent}}", + content: { + text: "WasmX module parameters retrieved successfully.", + action: "GET_WASMX_MODULE_PARAMS", + content: { + params: { + is_execution_enabled: true, + registration_fee: { + denom: "inj", + amount: "100000000000000000000", + }, + max_begin_block_tx_gas: 1000000, + max_contract_gas_limit: 500000, + min_gas_price: "1000000000", + }, + }, + }, + }, +]; + +export const getWasmxModuleStateExample = [ + { + user: "{{user1}}", + content: { + text: "Fetch current state of the WasmX module.", + }, + }, + { + user: "{{agent}}", + content: { + text: "WasmX module state retrieved successfully.", + action: "GET_WASMX_MODULE_STATE", + content: { + params: { + is_execution_enabled: true, + registration_fee: { + denom: "inj", + amount: "100000000000000000000", + }, + max_begin_block_tx_gas: 1000000, + max_contract_gas_limit: 500000, + min_gas_price: "1000000000", + }, + registered_contracts: [ + { + address: "inj1contract...", + gas_limit: 1000000, + gas_price: "1000000000", + is_executable: true, + code_id: 1, + }, + // ...additional registered contracts + ], + }, + }, + }, +]; + +export const getContractAccountsBalanceExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve contract accounts balance for contract address 'inj1contract...'.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Contract accounts balance retrieved successfully.", + action: "GET_CONTRACT_ACCOUNTS_BALANCE", + content: { + tokenInfo: { + name: "Example Token", + symbol: "EXT", + decimals: 18, + total_supply: "1000000000000000000000000", + mint: "inj1creator...", + }, + contractInfo: { + codeId: 1, + creator: "inj1creator...", + admin: "inj1admin...", + label: "Example Contract", + }, + marketingInfo: { + project: "Example Project", + description: "Example Description", + logo: { + url: "https://example.com/logo.png", + }, + marketing: "Example Marketing Info", + }, + contractAccountsBalance: [ + { + account: "inj1account...", + balance: "1000000000000000000", + }, + ], + pagination: { + nextKey: "xyz789...", + total: "100", + }, + }, + }, + }, +]; + +export const getContractStateExample = [ + { + user: "{{user1}}", + content: { + text: "Fetch contract state for contract address 'inj1contract...'.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Contract state retrieved successfully.", + action: "GET_CONTRACT_STATE", + content: { + tokenInfo: { + name: "Example Token", + symbol: "EXT", + decimals: 18, + total_supply: "1000000000000000000000000", + mint: "inj1creator...", + }, + contractInfo: { + codeId: 1, + creator: "inj1creator...", + admin: "inj1admin...", + label: "Example Contract", + }, + marketingInfo: { + project: "Example Project", + description: "Example Description", + logo: { + url: "https://example.com/logo.png", + }, + marketing: "Example Marketing Info", + }, + contractAccountsBalance: [ + { + account: "inj1account...", + balance: "1000000000000000000", + }, + ], + pagination: { + nextKey: "xyz789...", + total: "100", + }, + }, + }, + }, +]; + +export const getContractInfoExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve contract information for contract address 'inj1contract...'.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Contract information retrieved successfully.", + action: "GET_CONTRACT_INFO", + content: { + codeId: 1, + creator: "inj1creator...", + admin: "inj1admin...", + label: "Example Contract", + created: { + blockHeight: 1000000, + txIndex: 0, + }, + ibcPortId: "wasm.1", + extension: { + typeUrl: "example", + value: "base64encodeddata", + }, + }, + }, + }, +]; + +export const getContractHistoryExample = [ + { + user: "{{user1}}", + content: { + text: "Fetch contract history for contract address 'inj1contract...'.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Contract history retrieved successfully.", + action: "GET_CONTRACT_HISTORY", + content: { + entriesList: [ + { + operation: "CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT", + codeId: 1, + updated: { + blockHeight: 1000000, + txIndex: 0, + }, + msg: "base64encodeddata", + }, + ], + pagination: { + nextKey: "xyz789...", + total: "10", + }, + }, + }, + }, +]; + +export const getSmartContractStateExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve smart contract state for contract address 'inj1contract...' with query { get_state: {} }.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Smart contract state retrieved successfully.", + action: "GET_SMART_CONTRACT_STATE", + content: { + // Contract-specific state data + state: { + key1: "value1", + key2: "value2", + // ...additional state data + }, + }, + }, + }, +]; + +export const getRawContractStateExample = [ + { + user: "{{user1}}", + content: { + text: "Fetch raw contract state for contract address 'inj1contract...' with key 'base64encodedkey'.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Raw contract state retrieved successfully.", + action: "GET_RAW_CONTRACT_STATE", + content: { + data: "base64encodedvalue", + }, + }, + }, +]; + +export const getContractCodesExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve all contract codes with pagination key 'abc123...', offset 0, limit 100, and count total.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Contract codes retrieved successfully.", + action: "GET_CONTRACT_CODES", + content: { + codeInfosList: [ + { + codeId: 1, + creator: "inj1creator...", + dataHash: "base64encodeddata", + }, + ], + pagination: { + nextKey: "xyz789...", + total: "50", + }, + }, + }, + }, +]; + +export const getContractCodeExample = [ + { + user: "{{user1}}", + content: { + text: "Fetch contract code for code ID 1.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Contract code retrieved successfully.", + action: "GET_CONTRACT_CODE", + content: { + codeInfo: { + codeId: 1, + creator: "inj1creator...", + dataHash: "base64encodeddata", + }, + data: "base64encodedwasmcode", + }, + }, + }, +]; + +export const getContractCodeContractsExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve all contracts for code ID 1 with pagination key 'abc123...', offset 0, limit 100, and count total.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Contracts for code ID 1 retrieved successfully.", + action: "GET_CONTRACT_CODE_CONTRACTS", + content: { + contractsList: ["inj1contract1...", "inj2contract2..."], + pagination: { + nextKey: "xyz789...", + total: "20", + }, + }, + }, + }, +]; + +export const msgStoreCodeExample = [ + { + user: "{{user1}}", + content: { + text: "Store new contract code with sender 'inj1sender...' and WASM bytecode 'base64encodedwasmcode'.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Contract code stored successfully.", + action: "MSG_STORE_CODE", + content: { + txHash: "0xstorecodehash123def456ghi789jkl012mno345pqr678stu901vwx234yz", + success: true, + }, + }, + }, +]; + +export const msgUpdateAdminExample = [ + { + user: "{{user1}}", + content: { + text: "Update admin of contract 'inj1contract...' to new admin address 'inj2newadmin...'.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Contract admin updated successfully.", + action: "MSG_UPDATE_ADMIN", + content: { + txHash: "0xupdateadminhash123def456ghi789jkl012mno345pqr678stu901vwx234yz", + success: true, + }, + }, + }, +]; + +export const msgExecuteContractExample = [ + { + user: "{{user1}}", + content: { + text: "Execute contract 'inj2contract...' with message { execute: { action: 'transfer', amount: '1000000000000000000', recipient: 'inj3recipient...' } } and send funds [{ denom: 'inj', amount: '1000000000000000000' }].", + }, + }, + { + user: "{{agent}}", + content: { + text: "Contract executed successfully.", + action: "MSG_EXECUTE_CONTRACT", + content: { + txHash: "0xexecutecontracthash123def456ghi789jkl012mno345pqr678stu901vwx234yz", + success: true, + }, + }, + }, +]; + +export const msgMigrateContractExample = [ + { + user: "{{user1}}", + content: { + text: "Migrate contract 'inj2contract...' to new code ID 2 with migration message { migrate: { new_parameter: 'value' } }.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Contract migrated successfully.", + action: "MSG_MIGRATE_CONTRACT", + content: { + txHash: "0xmigratecontracthash123def456ghi789jkl012mno345pqr678stu901vwx234yz", + success: true, + }, + }, + }, +]; + +export const msgInstantiateContractExample = [ + { + user: "{{user1}}", + content: { + text: "Instantiate contract with sender 'inj1sender...', admin 'inj2admin...', code ID 1, label 'Example Contract', instantiation message { name: 'Example Token', symbol: 'EXT', decimals: 18, initial_balances: [{ address: 'inj3address...', amount: '1000000000000000000000000' }] }, and send funds [{ denom: 'inj', amount: '1000000000000000000' }].", + }, + }, + { + user: "{{agent}}", + content: { + text: "Contract instantiated successfully.", + action: "MSG_INSTANTIATE_CONTRACT", + content: { + txHash: "0xinstantiatecontracthash123def456ghi789jkl012mno345pqr678stu901vwx234yz", + success: true, + }, + }, + }, +]; + +export const msgExecuteContractCompatExample = [ + { + user: "{{user1}}", + content: { + text: "Execute contract 'inj2contract...' in compatibility mode with message { send: { to: 'inj3recipient...', amount: '1000000000000000000' } } and send funds [{ denom: 'inj', amount: '1000000000000000000' }].", + }, + }, + { + user: "{{agent}}", + content: { + text: "Contract executed successfully in compatibility mode.", + action: "MSG_EXECUTE_CONTRACT_COMPAT", + content: { + txHash: "0xexecutecompathash123def456ghi789jkl012mno345pqr678stu901vwx234yz", + success: true, + }, + }, + }, +]; + +export const msgPrivilegedExecuteContractExample = [ + { + user: "{{user1}}", + content: { + text: "Privileged execute contract 'inj2contract...' with message { privileged_action: { parameter: 'value' } }.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Privileged contract execution submitted successfully.", + action: "MSG_PRIVILEGED_EXECUTE_CONTRACT", + content: { + txHash: "0xprivilegedexecutehash123def456ghi789jkl012mno345pqr678stu901vwx234yz", + success: true, + }, + }, + }, +]; + +export const getContractStateByKeyExample = [ + { + user: "{{user1}}", + content: { + text: "Fetch contract state for contract address 'inj1contract...' with key 'base64encodedkey'.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Contract state for key 'base64encodedkey' retrieved successfully.", + action: "GET_CONTRACT_STATE_BY_KEY", + content: { + data: "base64encodedvalue", + }, + }, + }, +]; + +export const getContractHistoryByOperationExample = [ + { + user: "{{user1}}", + content: { + text: "Fetch contract history for contract address 'inj1contract...' with operation type 'Init'.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Contract history for operation type 'Init' retrieved successfully.", + action: "GET_CONTRACT_HISTORY_BY_OPERATION", + content: { + entries: [ + { + operation: "Init", + codeId: 1, + updated: { + blockHeight: 1000000, + txIndex: 0, + }, + msg: "base64encodeddata", + }, + ], + }, + }, + }, +]; + +export const getContractCodeHistoryExample = [ + { + user: "{{user1}}", + content: { + text: "Retrieve complete contract code history for contract address 'inj1contract...' with pagination key 'abc123...', offset 0, limit 100, and count total.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Complete contract code history retrieved successfully.", + action: "GET_CONTRACT_CODE_HISTORY", + content: { + history: [ + { + codeId: 1, + timeStamp: "2024-01-01T00:00:00Z", + operation: "Init", + msg: "base64encodeddata", + initiator: "inj1admin...", + }, + ], + pagination: { + nextKey: "xyz789...", + total: "10", + }, + }, + }, + }, +]; + +export const getContractEventsExample = [ + { + user: "{{user1}}", + content: { + text: "Fetch contract events for contract address 'inj1contract...' with event type 'wasm' and pagination key 'abc123...', offset 0, limit 100, and count total.", + }, + }, + { + user: "{{agent}}", + content: { + text: "Contract events retrieved successfully.", + action: "GET_CONTRACT_EVENTS", + content: { + events: [ + { + type: "wasm", + attributes: [ + { + key: "action", + value: "transfer", + }, + { + key: "amount", + value: "1000000000000000000", + }, + ], + blockHeight: 1000000, + txHash: "0xeventtxhash123def456ghi789jkl012mno345pqr678stu901vwx234yz", + }, + ], + pagination: { + nextKey: "xyz789...", + total: "100", + }, + }, + }, + }, +]; diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/exceptions/GrpcException.ts b/packages/plugin-injective/injective-sdk-client-ts/src/exceptions/GrpcException.ts new file mode 100644 index 00000000000..7f5f48cdc14 --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/exceptions/GrpcException.ts @@ -0,0 +1,24 @@ +import { + GeneralException, + UnspecifiedErrorCode, +} from "@injectivelabs/exceptions"; + +export class GrpcException extends GeneralException { + constructor( + error: Error | string, + public code = UnspecifiedErrorCode, + public contextModule?: string + ) { + super(error instanceof Error ? error : new Error(error)); + this.name = "GrpcException"; + } + + public toJSON() { + return { + name: this.name, + message: this.message, + code: this.code, + contextModule: this.contextModule, + }; + } +} diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/exceptions/index.ts b/packages/plugin-injective/injective-sdk-client-ts/src/exceptions/index.ts new file mode 100644 index 00000000000..d85ddc9ae63 --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/exceptions/index.ts @@ -0,0 +1 @@ +export * from "./GrpcException"; diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/grpc/grpc-base.ts b/packages/plugin-injective/injective-sdk-client-ts/src/grpc/grpc-base.ts new file mode 100644 index 00000000000..6ee22177a52 --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/grpc/grpc-base.ts @@ -0,0 +1,242 @@ +// We need to add the following: +// basically wrap rpc requests, query, and response +// TODO : Assert type safety for the requests +import { Network, getNetworkEndpoints } from "@injectivelabs/networks"; +//chain imports +import { + ChainGrpcAuctionApi, + ChainGrpcAuthApi, + ChainGrpcAuthZApi, + ChainGrpcBankApi, + ChainGrpcDistributionApi, + ChainGrpcExchangeApi, + ChainGrpcGovApi, + ChainGrpcIbcApi, + ChainGrpcInsuranceFundApi, + ChainGrpcMintApi, + ChainGrpcOracleApi, + ChainGrpcPeggyApi, + ChainGrpcPermissionsApi, + ChainGrpcStakingApi, + ChainGrpcTendermintApi, + ChainGrpcTokenFactoryApi, + ChainGrpcWasmApi, + ChainGrpcWasmXApi, + MsgBroadcasterWithPk, +} from "@injectivelabs/sdk-ts"; +//indexer imports +import { + IndexerGrpcAccountApi, + IndexerGrpcArchiverApi, + IndexerGrpcAuctionApi, + IndexerGrpcDerivativesApi, + IndexerGrpcExplorerApi, + IndexerGrpcInsuranceFundApi, + IndexerGrpcMitoApi, + IndexerGrpcOracleApi, + IndexerGrpcAccountPortfolioApi, + IndexerGrpcSpotApi, + IndexerGrpcTradingApi, + IndexerGrpcWeb3GwApi, +} from "@injectivelabs/sdk-ts"; +//minimal rest imports +import { + ChainRestAuthApi, + ChainRestTendermintApi, + getInjectiveAddress, + getEthereumAddress, +} from "@injectivelabs/sdk-ts"; + +export type RequestMethod = ( + request: TRequest +) => Promise; + +export interface GrpcRequestOptions { + method: RequestMethod; + params: TRequest; + endpoint?: string; +} + +export interface GrpcQueryOptions { + method: RequestMethod; + params: TRequest; + endpoint?: string; +} + +export class InjectiveGrpcBase { + protected readonly network: Network; + protected readonly endpoints: ReturnType; + //rest for auth + protected readonly chainRestAuthApi: ChainRestAuthApi; + protected readonly chainRestTendermintApi: ChainRestTendermintApi; + //add all chain grpc endpoints here + protected readonly chainGrpcAuctionApi: ChainGrpcAuctionApi; + protected readonly chainGrpcAuthApi: ChainGrpcAuthApi; + protected readonly chainGrpcAuthZApi: ChainGrpcAuthZApi; + protected readonly chainGrpcBankApi: ChainGrpcBankApi; + protected readonly chainGrpcDistributionApi: ChainGrpcDistributionApi; + protected readonly chainGrpcExchangeApi: ChainGrpcExchangeApi; + protected readonly chainGrpcGovApi: ChainGrpcGovApi; + protected readonly chainGrpcIbcApi: ChainGrpcIbcApi; + protected readonly chainGrpcInsuranceFundApi: ChainGrpcInsuranceFundApi; + protected readonly chainGrpcMintApi: ChainGrpcMintApi; + protected readonly chainGrpcOracleApi: ChainGrpcOracleApi; + protected readonly chainGrpcPeggyApi: ChainGrpcPeggyApi; + protected readonly chainGrpcPermissionsApi: ChainGrpcPermissionsApi; + protected readonly chainGrpcStakingApi: ChainGrpcStakingApi; + protected readonly chainGrpcTendermintApi: ChainGrpcTendermintApi; + protected readonly chainGrpcTokenFactoryApi: ChainGrpcTokenFactoryApi; + protected readonly chainGrpcWasmApi: ChainGrpcWasmApi; + protected readonly chainGrpcWasmXApi: ChainGrpcWasmXApi; + + //add all indexer grpc endpoints here + protected readonly indexerGrpcAuctionApi: IndexerGrpcAuctionApi; + //these are majorly exchange module's + protected readonly indexerGrpcDerivativesApi: IndexerGrpcDerivativesApi; + protected readonly indexerGrpcAccountApi: IndexerGrpcAccountApi; + protected readonly indexerGrpcAccountPortfolioApi: IndexerGrpcAccountPortfolioApi; + protected readonly indexerGrpcSpotApi: IndexerGrpcSpotApi; + protected readonly indexerGrpcInsuranceFundApi: IndexerGrpcInsuranceFundApi; + protected readonly indexerGrpcTradingApi: IndexerGrpcTradingApi; + protected readonly indexerGrpcArchiverApi: IndexerGrpcArchiverApi; + + //this is explorer import + protected readonly indexerGrpcExplorerApi: IndexerGrpcExplorerApi; + + protected readonly indexerGrpcMitoApi: IndexerGrpcMitoApi; + protected readonly indexerGrpcOracleApi: IndexerGrpcOracleApi; + protected readonly indexerGrpcWeb3GwApi: IndexerGrpcWeb3GwApi; + + protected readonly ethAddress: string; + protected readonly injAddress: string; + private privateKey: string; + protected msgBroadcaster!: MsgBroadcasterWithPk; + constructor( + protected readonly networkType: keyof typeof Network = "Mainnet", + protected readonly injectivePrivateKey: string, + protected readonly ethPublicKey?: string, + protected readonly injPublicKey?: string + ) { + this.network = Network[networkType]; + this.endpoints = getNetworkEndpoints(this.network); + //Initialize the broadcaster + + // Initialize Chain gRPCs + this.chainGrpcAuctionApi = new ChainGrpcAuctionApi(this.endpoints.grpc); + this.chainGrpcAuthApi = new ChainGrpcAuthApi(this.endpoints.grpc); + this.chainGrpcAuthZApi = new ChainGrpcAuthZApi(this.endpoints.grpc); + this.chainGrpcBankApi = new ChainGrpcBankApi(this.endpoints.grpc); + this.chainGrpcDistributionApi = new ChainGrpcDistributionApi( + this.endpoints.grpc + ); + this.chainGrpcExchangeApi = new ChainGrpcExchangeApi( + this.endpoints.grpc + ); + this.chainGrpcGovApi = new ChainGrpcGovApi(this.endpoints.grpc); + this.chainGrpcIbcApi = new ChainGrpcIbcApi(this.endpoints.grpc); + this.chainGrpcInsuranceFundApi = new ChainGrpcInsuranceFundApi( + this.endpoints.grpc + ); + this.chainGrpcMintApi = new ChainGrpcMintApi(this.endpoints.grpc); + this.chainGrpcOracleApi = new ChainGrpcOracleApi(this.endpoints.grpc); + this.chainGrpcPeggyApi = new ChainGrpcPeggyApi(this.endpoints.grpc); + this.chainGrpcPermissionsApi = new ChainGrpcPermissionsApi( + this.endpoints.grpc + ); + this.chainGrpcStakingApi = new ChainGrpcStakingApi(this.endpoints.grpc); + this.chainGrpcTendermintApi = new ChainGrpcTendermintApi( + this.endpoints.grpc + ); + this.chainGrpcTokenFactoryApi = new ChainGrpcTokenFactoryApi( + this.endpoints.grpc + ); + this.chainGrpcWasmApi = new ChainGrpcWasmApi(this.endpoints.grpc); + this.chainGrpcWasmXApi = new ChainGrpcWasmXApi(this.endpoints.grpc); + + // Initialize Indexer gRPCs + // All exchange related functions + this.indexerGrpcDerivativesApi = new IndexerGrpcDerivativesApi( + this.endpoints.indexer + ); + this.indexerGrpcAccountApi = new IndexerGrpcAccountApi( + this.endpoints.indexer + ); + this.indexerGrpcInsuranceFundApi = new IndexerGrpcInsuranceFundApi( + this.endpoints.indexer + ); + this.indexerGrpcAccountPortfolioApi = + new IndexerGrpcAccountPortfolioApi(this.endpoints.indexer); + this.indexerGrpcTradingApi = new IndexerGrpcTradingApi( + this.endpoints.indexer + ); + this.indexerGrpcSpotApi = new IndexerGrpcSpotApi( + this.endpoints.indexer + ); + // End of exchange functions + this.indexerGrpcArchiverApi = new IndexerGrpcArchiverApi( + this.endpoints.indexer + ); + this.indexerGrpcAuctionApi = new IndexerGrpcAuctionApi( + this.endpoints.indexer + ); + this.indexerGrpcExplorerApi = new IndexerGrpcExplorerApi( + this.endpoints.indexer + ); + //TODO: WARNING replace with testnet env, dont leave this hardcoded + const MITO_API_ENDPOINT = + "https://k8s.mainnet.mito.grpc-web.injective.network"; + this.indexerGrpcMitoApi = new IndexerGrpcMitoApi(MITO_API_ENDPOINT); + this.indexerGrpcOracleApi = new IndexerGrpcOracleApi( + this.endpoints.indexer + ); + this.indexerGrpcWeb3GwApi = new IndexerGrpcWeb3GwApi( + this.endpoints.indexer + ); + + // Minimal REST endpoint - TODO: need to move this into REST client + + this.chainRestAuthApi = new ChainRestAuthApi(this.endpoints.rest); + this.chainRestTendermintApi = new ChainRestTendermintApi( + this.endpoints.rest + ); + + // Initialize EthAddress and InjAddress + this.ethAddress = + ethPublicKey || + (injPublicKey ? getEthereumAddress(injPublicKey) : ""); + + this.injAddress = + injPublicKey || + (ethPublicKey ? getInjectiveAddress(ethPublicKey) : ""); + + this.privateKey = injectivePrivateKey; + + this.msgBroadcaster = new MsgBroadcasterWithPk({ + network: this.network, + privateKey: this.privateKey, + }); + } + /** + * Get network configuration + * @returns Current network endpoints + */ + protected getNetworkConfig() { + return { + network: this.network, + endpoints: this.endpoints, + }; + } + + /** + * Check if the connection is alive + * @returns Promise resolving to boolean indicating connection status + */ + protected async isConnectionAlive(): Promise { + try { + await this.chainGrpcAuthApi.fetchModuleParams(); + return true; + } catch { + return false; + } + } +} diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/modules/Ibc.ts b/packages/plugin-injective/injective-sdk-client-ts/src/modules/Ibc.ts new file mode 100644 index 00000000000..6b990c78b1e --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/modules/Ibc.ts @@ -0,0 +1,78 @@ +import { InjectiveGrpcBase } from "../grpc/grpc-base.js"; +import { PaginationOption } from "@injectivelabs/ts-types"; +import { MsgTransfer, TxResponse } from "@injectivelabs/sdk-ts"; +import * as IBCTypes from "../types/ibc"; // Assuming IBC types are in ibc.ts +import { + StandardResponse, + createSuccessResponse, + createErrorResponse, +} from "../types/index"; + +/** + * IBC Module Chain GRPC Async Functions with Error Handling + */ + +/** + * Fetches the denomination trace for a specific hash. + * + * @this InjectiveGrpcBase + * @param {IBCTypes.GetDenomTraceParams} params - Parameters including the denomination hash. + * @returns {Promise} The standard response containing the denomination trace or an error. + */ +export async function getDenomTrace( + this: InjectiveGrpcBase, + params: IBCTypes.GetDenomTraceParams +): Promise { + try { + const result = await this.chainGrpcIbcApi.fetchDenomTrace(params.hash); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getDenomTraceError", err); + } +} + +/** + * Fetches a list of denomination traces with optional pagination. + * + * @this InjectiveGrpcBase + * @param {IBCTypes.GetDenomsTraceParams} [params] - Optional parameters including pagination options. + * @returns {Promise} The standard response containing a list of denomination traces or an error. + */ +export async function getDenomsTrace( + this: InjectiveGrpcBase, + params: IBCTypes.GetDenomsTraceParams +): Promise { + try { + const result = await this.chainGrpcIbcApi.fetchDenomsTrace( + params.pagination + ); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getDenomsTraceError", err); + } +} + +/** + * Broadcasts an IBC transfer message. + * + * @this InjectiveGrpcBase + * @param {IBCTypes.MsgIBCTransferParams} params - Parameters to perform the IBC transfer. + * @returns {Promise} The standard response containing the transaction result or an error. + */ +export async function msgIBCTransfer( + this: InjectiveGrpcBase, + params: IBCTypes.MsgIBCTransferParams +): Promise { + try { + const msg = MsgTransfer.fromJSON({ + ...params, + sender: this.injAddress, + }); + const result: TxResponse = await this.msgBroadcaster.broadcast({ + msgs: msg, + }); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("msgIBCTransferError", err); + } +} diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/modules/auction.ts b/packages/plugin-injective/injective-sdk-client-ts/src/modules/auction.ts new file mode 100644 index 00000000000..8b0454acfcb --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/modules/auction.ts @@ -0,0 +1,128 @@ +import { InjectiveGrpcBase } from "../grpc/grpc-base"; +import { MsgBid } from "@injectivelabs/sdk-ts"; +import * as AuctionTypes from "../types/auction"; +import { + StandardResponse, + createSuccessResponse, + createErrorResponse, +} from "../types/index"; +import { INJ_DENOM } from "@injectivelabs/utils"; + +/** + * Fetches the auction module parameters. + * + * @this InjectiveGrpcBase + * @returns {Promise} The standard response containing module parameters or an error. + */ +export async function getAuctionModuleParams( + this: InjectiveGrpcBase +): Promise { + try { + const result = this.chainGrpcAuctionApi.fetchModuleParams(); + + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getAuctionModuleParamsError", err); + } +} + +/** + * Fetches the auction module state. + * + * @this InjectiveGrpcBase + * @returns {Promise} The standard response containing module state or an error. + */ +export async function getAuctionModuleState( + this: InjectiveGrpcBase +): Promise { + try { + const result = await this.chainGrpcAuctionApi.fetchModuleState(); + + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getAuctionModuleStateError", err); + } +} + +/** + * Fetches the current auction basket. + * + * @this InjectiveGrpcBase + * @returns {Promise} The standard response containing the current basket or an error. + */ +export async function getCurrentBasket( + this: InjectiveGrpcBase +): Promise { + try { + const result = await this.chainGrpcAuctionApi.fetchCurrentBasket(); + + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getCurrentBasketError", err); + } +} + +/** + * Fetches details of a specific auction round. + * + * @this InjectiveGrpcBase + * @param {AuctionTypes.GetAuctionRoundParams} params - Parameters including the auction round number. + * @returns {Promise} The standard response containing auction round details or an error. + */ +export async function getAuctionRound( + this: InjectiveGrpcBase, + params: AuctionTypes.GetAuctionRoundParams +): Promise { + try { + const result = await this.indexerGrpcAuctionApi.fetchAuction( + params.round + ); + + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getAuctionRoundError", err); + } +} + +/** + * Fetches a list of auctions based on provided parameters. + * + * @this InjectiveGrpcBase + * @param {AuctionTypes.GetAuctionsParams} params - Parameters to filter auctions. + * @returns {Promise} The standard response containing a list of auctions or an error. + */ +export async function getAuctions( + this: InjectiveGrpcBase +): Promise { + try { + const result = await this.indexerGrpcAuctionApi.fetchAuctions(); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getAuctionsError", err); + } +} + +/** + * Places a bid in an auction round. + * + * @this InjectiveGrpcBase + * @param {AuctionTypes.MsgBidRequestParams} params - Parameters including round number and bid amount. + * @returns {Promise} The standard response containing the transaction result or an error. + */ +export async function msgBid( + this: InjectiveGrpcBase, + params: AuctionTypes.MsgBidRequestParams +): Promise { + try { + const amount = { denom: INJ_DENOM, amount: params.amount }; + const msg = MsgBid.fromJSON({ + round: params.round, + injectiveAddress: this.injAddress, + amount: amount, + }); + const result = await this.msgBroadcaster.broadcast({ msgs: msg }); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("msgBidError", err); + } +} diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/modules/auth.ts b/packages/plugin-injective/injective-sdk-client-ts/src/modules/auth.ts new file mode 100644 index 00000000000..9ea8258a638 --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/modules/auth.ts @@ -0,0 +1,61 @@ +import { InjectiveGrpcBase } from "../grpc/grpc-base"; +import { + StandardResponse, + createSuccessResponse, + createErrorResponse, +} from "../types"; + +/** + * Fetches the authentication module parameters. + * + * @this InjectiveGrpcBase + * @returns {Promise} The standard response containing module parameters or an error. + */ +export async function getAuthModuleParams( + this: InjectiveGrpcBase +): Promise { + try { + const result = await this.chainGrpcAuthApi.fetchModuleParams(); + + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getAuthModuleParamsError", err); + } +} + +/** + * Fetches the details of the current account. + * + * @this InjectiveGrpcBase + * @returns {Promise} The standard response containing account details or an error. + */ +export async function getAccountDetails( + this: InjectiveGrpcBase +): Promise { + try { + const result = await this.chainGrpcAuthApi.fetchAccount( + this.injAddress + ); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getAccountDetailsError", err); + } +} + +/** + * Fetches all accounts associated with the current address. + * + * @this InjectiveGrpcBase + * @returns {Promise} The standard response containing all accounts or an error. + */ +export async function getAccounts( + this: InjectiveGrpcBase +): Promise { + try { + const result = await this.chainGrpcAuthApi.fetchAccounts(); + + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getAccountsError", err); + } +} diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/modules/authz.ts b/packages/plugin-injective/injective-sdk-client-ts/src/modules/authz.ts new file mode 100644 index 00000000000..f6c1379f258 --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/modules/authz.ts @@ -0,0 +1,141 @@ +import { InjectiveGrpcBase } from "../grpc/grpc-base"; +import { MsgGrant, MsgRevoke, MsgAuthzExec } from "@injectivelabs/sdk-ts"; +import * as AuthzTypes from "../types/auth"; +import { + StandardResponse, + createSuccessResponse, + createErrorResponse, +} from "../types/index"; + +/** + * Fetches all grants based on provided parameters. + * + * @this InjectiveGrpcBase + * @param {AuthzTypes.GetGrantsParams} params - Parameters to filter grants. + * @returns {Promise} The standard response containing grants or an error. + */ +export async function getGrants( + this: InjectiveGrpcBase, + params: AuthzTypes.GetGrantsParams +): Promise { + try { + const result = await this.chainGrpcAuthZApi.fetchGrants(params); + + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getGrantsError", err); + } +} + +/** + * Fetches all grants granted by a specific granter. + * + * @this InjectiveGrpcBase + * @param {AuthzTypes.GetGranterGrantsParams} params - Parameters including the granter's address. + * @returns {Promise} The standard response containing grants or an error. + */ +export async function getGranterGrants( + this: InjectiveGrpcBase, + params: AuthzTypes.GetGranterGrantsParams +): Promise { + try { + const result = await this.chainGrpcAuthZApi.fetchGranterGrants( + params.granter + ); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getGranterGrantsError", err); + } +} + +/** + * Fetches all grants received by a specific grantee. + * + * @this InjectiveGrpcBase + * @param {AuthzTypes.GetGranteeGrantsParams} params - Parameters including the grantee's address. + * @returns {Promise} The standard response containing grants or an error. + */ +export async function getGranteeGrants( + this: InjectiveGrpcBase, + params: AuthzTypes.GetGranteeGrantsParams +): Promise { + try { + const result = await this.chainGrpcAuthZApi.fetchGranteeGrants( + params.grantee + ); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getGranteeGrantsError", err); + } +} + +/** + * Grants authorization to a grantee to perform specific actions on behalf of the granter. + * + * @this InjectiveGrpcBase + * @param {AuthzTypes.MsgGrantParams} params - Parameters including message type, grantee, and granter. + * @returns {Promise} The standard response containing the transaction result or an error. + */ +export async function msgGrant( + this: InjectiveGrpcBase, + params: AuthzTypes.MsgGrantParams +): Promise { + try { + const msg = MsgGrant.fromJSON({ + messageType: params.messageType, + grantee: params.grantee, + granter: params.granter, + }); + const result = await this.msgBroadcaster.broadcast({ msgs: msg }); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("msgGrantError", err); + } +} + +/** + * Executes authorized messages on behalf of the grantee. + * + * @this InjectiveGrpcBase + * @param {AuthzTypes.MsgAuthzExecParams} params - Parameters including grantee and messages to execute. + * @returns {Promise} The standard response containing the transaction result or an error. + */ +export async function msgExec( + this: InjectiveGrpcBase, + params: AuthzTypes.MsgAuthzExecParams +): Promise { + try { + const msg = MsgAuthzExec.fromJSON({ + grantee: params.grantee, + msgs: params.msgs, + }); + const result = await this.msgBroadcaster.broadcast({ msgs: msg }); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("msgExecError", err); + } +} + +/** + * Revokes previously granted authorizations from a grantee. + * + * @this InjectiveGrpcBase + * @param {AuthzTypes.MsgRevokeParams} params - Parameters including message type, grantee, and granter. + * @returns {Promise} The standard response containing the transaction result or an error. + */ +export async function msgRevoke( + this: InjectiveGrpcBase, + params: AuthzTypes.MsgRevokeParams +): Promise { + try { + const msg = MsgRevoke.fromJSON({ + messageType: params.messageType, + grantee: params.grantee, + granter: params.granter, + }); + const result = await this.msgBroadcaster.broadcast({ msgs: msg }); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("msgRevokeError", err); + } +} diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/modules/bank.ts b/packages/plugin-injective/injective-sdk-client-ts/src/modules/bank.ts new file mode 100644 index 00000000000..cf6af2dc3fd --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/modules/bank.ts @@ -0,0 +1,232 @@ +import { InjectiveGrpcBase } from "../grpc/grpc-base"; +import { MsgSend, MsgMultiSend } from "@injectivelabs/sdk-ts"; +import * as BankTypes from "../types/bank"; +import { + StandardResponse, + createSuccessResponse, + createErrorResponse, +} from "../types/index"; + +// Bank Module Chain GRPC Async Functions with Error Handling + +/** + * Fetches the bank module parameters. + * + * @this InjectiveGrpcBase + * @returns {Promise} The standard response containing module parameters or an error. + */ +export async function getBankModuleParams( + this: InjectiveGrpcBase +): Promise { + try { + const result = await this.chainGrpcBankApi.fetchModuleParams(); + + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getBankModuleParamsError", err); + } +} + +/** + * Fetches the balance of a specific account. + * + * @this InjectiveGrpcBase + * @param {BankTypes.GetBankBalanceParams} params - Parameters including account address. + * @returns {Promise} The standard response containing the balance or an error. + */ +export async function getBankBalance( + this: InjectiveGrpcBase, + params: BankTypes.GetBankBalanceParams +): Promise { + try { + const result = await this.chainGrpcBankApi.fetchBalance({ + ...params, + accountAddress: this.injAddress, + }); + + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getBankBalanceError", err); + } +} + +/** + * Fetches all balances for the current account. + * + * @this InjectiveGrpcBase + * @param {BankTypes.GetBankBalancesParams} params - Parameters including account identifier. + * @returns {Promise} The standard response containing all balances or an error. + */ +export async function getBankBalances( + this: InjectiveGrpcBase, + params: BankTypes.GetBankBalancesParams +): Promise { + try { + const result = await this.chainGrpcBankApi.fetchBalances( + this.injAddress + ); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getBankBalancesError", err); + } +} + +/** + * Fetches the total supply of all denominations. + * + * @this InjectiveGrpcBase + * @returns {Promise} The standard response containing total supply or an error. + */ +export async function getTotalSupply( + this: InjectiveGrpcBase +): Promise { + try { + const result = await this.chainGrpcBankApi.fetchTotalSupply(); + + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getTotalSupplyError", err); + } +} + +/** + * Fetches the total supply for all denominations. + * + * @this InjectiveGrpcBase + * @returns {Promise} The standard response containing all total supplies or an error. + */ +export async function getAllTotalSupply( + this: InjectiveGrpcBase +): Promise { + try { + const result = await this.chainGrpcBankApi.fetchAllTotalSupply(); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getAllTotalSupplyError", err); + } +} + +/** + * Fetches the supply of a specific denomination. + * + * @this InjectiveGrpcBase + * @param {BankTypes.GetSupplyOfParams} params - Parameters including denomination. + * @returns {Promise} The standard response containing the supply or an error. + */ +export async function getSupplyOf( + this: InjectiveGrpcBase, + params: BankTypes.GetSupplyOfParams +): Promise { + try { + const result = await this.chainGrpcBankApi.fetchSupplyOf(params.denom); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getSupplyOfError", err); + } +} + +/** + * Fetches metadata for all denominations. + * + * @this InjectiveGrpcBase + * @returns {Promise} The standard response containing denomination metadata or an error. + */ +export async function getDenomsMetadata( + this: InjectiveGrpcBase +): Promise { + try { + const result = await this.chainGrpcBankApi.fetchDenomsMetadata(); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getDenomsMetadataError", err); + } +} + +/** + * Fetches metadata for a specific denomination. + * + * @this InjectiveGrpcBase + * @param {BankTypes.GetDenomMetadataParams} params - Parameters including denomination. + * @returns {Promise} The standard response containing denomination metadata or an error. + */ +export async function getDenomMetadata( + this: InjectiveGrpcBase, + params: BankTypes.GetDenomMetadataParams +): Promise { + try { + const result = await this.chainGrpcBankApi.fetchDenomMetadata( + params.denom + ); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getDenomMetadataError", err); + } +} + +/** + * Fetches the owners of a specific denomination. + * + * @this InjectiveGrpcBase + * @param {BankTypes.GetDenomOwnersParams} params - Parameters including denomination. + * @returns {Promise} The standard response containing denomination owners or an error. + */ +export async function getDenomOwners( + this: InjectiveGrpcBase, + params: BankTypes.GetDenomOwnersParams +): Promise { + try { + const result = await this.chainGrpcBankApi.fetchDenomOwners( + params.denom + ); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getDenomOwnersError", err); + } +} + +/** + * Sends tokens from one account to another. + * + * @this InjectiveGrpcBase + * @param {BankTypes.MsgSendParams} params - Parameters including sender, receiver, and amount. + * @returns {Promise} The standard response containing the transaction result or an error. + */ +export async function msgSend( + this: InjectiveGrpcBase, + params: BankTypes.MsgSendParams +): Promise { + try { + const msg = MsgSend.fromJSON({ + amount: params.amount, + srcInjectiveAddress: params.srcInjectiveAddress, + dstInjectiveAddress: params.dstInjectiveAddress, + }); + const result = await this.msgBroadcaster.broadcast({ msgs: msg }); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("msgSendError", err); + } +} + +/** + * Sends tokens from multiple senders to multiple receivers. + * + * @this InjectiveGrpcBase + * @param {BankTypes.MsgMultiSendParams} params - Parameters including inputs and outputs. + * @returns {Promise} The standard response containing the transaction result or an error. + */ +export async function msgMultiSend( + this: InjectiveGrpcBase, + params: BankTypes.MsgMultiSendParams +): Promise { + try { + const msg = MsgMultiSend.fromJSON({ + inputs: params.inputs, + outputs: params.outputs, + }); + const result = await this.msgBroadcaster.broadcast({ msgs: msg }); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("msgMultiSendError", err); + } +} diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/modules/distribution.ts b/packages/plugin-injective/injective-sdk-client-ts/src/modules/distribution.ts new file mode 100644 index 00000000000..8c1d740f339 --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/modules/distribution.ts @@ -0,0 +1,173 @@ +import { InjectiveGrpcBase } from "../grpc/grpc-base"; +import { + MsgWithdrawDelegatorReward, + MsgWithdrawValidatorCommission, +} from "@injectivelabs/sdk-ts"; +import * as DistributionTypes from "../types/distribution"; +import { + StandardResponse, + createSuccessResponse, + createErrorResponse, +} from "../types/index"; + +// Distribution Module Async Functions with Error Handling + +/** + * Fetches the distribution module parameters. + * + * @this InjectiveGrpcBase + * @returns {Promise} The standard response containing module parameters or an error. + */ +export async function getDistributionModuleParams( + this: InjectiveGrpcBase +): Promise { + try { + const result = await this.chainGrpcDistributionApi.fetchModuleParams(); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getDistributionModuleParamsError", err); + } +} + +/** + * Fetches the delegator rewards for a specific validator. + * + * @this InjectiveGrpcBase + * @param {DistributionTypes.GetDelegatorRewardsForValidatorParams} params - Parameters including delegator and validator addresses. + * @returns {Promise} The standard response containing delegator rewards or an error. + */ +export async function getDelegatorRewardsForValidator( + this: InjectiveGrpcBase, + params: DistributionTypes.GetDelegatorRewardsForValidatorParams +): Promise { + try { + const result = + await this.chainGrpcDistributionApi.fetchDelegatorRewardsForValidator( + { + delegatorAddress: params.delegatorAddress, + validatorAddress: params.validatorAddress, + } + ); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getDelegatorRewardsForValidatorError", err); + } +} + +/** + * Fetches the delegator rewards for a specific validator without throwing an error. + * + * @this InjectiveGrpcBase + * @param {DistributionTypes.GetDelegatorRewardsForValidatorParams} params - Parameters including delegator and validator addresses. + * @returns {Promise} The standard response containing delegator rewards or an error. + */ +export async function getDelegatorRewardsForValidatorNoThrow( + this: InjectiveGrpcBase, + params: DistributionTypes.GetDelegatorRewardsForValidatorParams +): Promise { + try { + const result = + await this.chainGrpcDistributionApi.fetchDelegatorRewardsForValidatorNoThrow( + { + delegatorAddress: params.delegatorAddress, + validatorAddress: params.validatorAddress, + } + ); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse( + "getDelegatorRewardsForValidatorNoThrowError", + err + ); + } +} + +/** + * Fetches the rewards for a delegator. + * + * @this InjectiveGrpcBase + * @param {DistributionTypes.GetDelegatorRewardsParams} params - Parameters including the delegator's Injective address. + * @returns {Promise} The standard response containing delegator rewards or an error. + */ +export async function getDelegatorRewards( + this: InjectiveGrpcBase, + params: DistributionTypes.GetDelegatorRewardsParams +): Promise { + try { + const result = + await this.chainGrpcDistributionApi.fetchDelegatorRewards( + params.injectiveAddress + ); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getDelegatorRewardsError", err); + } +} + +/** + * Fetches the rewards for a delegator without throwing an error. + * + * @this InjectiveGrpcBase + * @param {DistributionTypes.GetDelegatorRewardsParams} params - Parameters including the delegator's Injective address. + * @returns {Promise} The standard response containing delegator rewards or an error. + */ +export async function getDelegatorRewardsNoThrow( + this: InjectiveGrpcBase, + params: DistributionTypes.GetDelegatorRewardsParams +): Promise { + try { + const result = + await this.chainGrpcDistributionApi.fetchDelegatorRewardsNoThrow( + params.injectiveAddress + ); + + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getDelegatorRewardsNoThrowError", err); + } +} + +/** + * Broadcasts a message to withdraw delegator rewards. + * + * @this InjectiveGrpcBase + * @param {DistributionTypes.MsgWithdrawDelegatorRewardParams} params - Parameters including delegator and validator addresses. + * @returns {Promise} The standard response containing the broadcast result or an error. + */ +export async function msgWithdrawDelegatorReward( + this: InjectiveGrpcBase, + params: DistributionTypes.MsgWithdrawDelegatorRewardParams +): Promise { + try { + const msg = MsgWithdrawDelegatorReward.fromJSON({ + delegatorAddress: params.delegatorAddress, + validatorAddress: params.validatorAddress, + }); + const result = await this.msgBroadcaster.broadcast({ msgs: msg }); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("msgWithdrawDelegatorRewardError", err); + } +} + +/** + * Broadcasts a message to withdraw validator commission. + * + * @this InjectiveGrpcBase + * @param {DistributionTypes.MsgWithdrawValidatorCommissionParams} params - Parameters including the validator's address. + * @returns {Promise} The standard response containing the broadcast result or an error. + */ +export async function msgWithdrawValidatorCommission( + this: InjectiveGrpcBase, + params: DistributionTypes.MsgWithdrawValidatorCommissionParams +): Promise { + try { + const msg = MsgWithdrawValidatorCommission.fromJSON({ + validatorAddress: params.validatorAddress, + }); + const result = await this.msgBroadcaster.broadcast({ msgs: msg }); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("msgWithdrawValidatorCommissionError", err); + } +} diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/modules/exchange.ts b/packages/plugin-injective/injective-sdk-client-ts/src/modules/exchange.ts new file mode 100644 index 00000000000..014a8296bb8 --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/modules/exchange.ts @@ -0,0 +1,1679 @@ +import { InjectiveGrpcBase } from "../grpc/grpc-base"; +import { + BinaryOptionsMarket, + DerivativeLimitOrder, + DerivativeOrderHistory, + Position, + PositionV2, + DerivativeTrade, + FundingPayment, + FundingRate, + ExchangePagination, + SubaccountTransfer, + SpotLimitOrder, + SpotOrderHistory, + SpotTrade, + AtomicSwap, + MsgAdminUpdateBinaryOptionsMarket, + MsgBatchCancelBinaryOptionsOrders, + MsgBatchCancelDerivativeOrders, + MsgBatchCancelSpotOrders, + MsgBatchUpdateOrders, + MsgCancelBinaryOptionsOrder, + MsgCancelDerivativeOrder, + MsgCancelSpotOrder, + MsgCreateBinaryOptionsLimitOrder, + MsgCreateBinaryOptionsMarketOrder, + MsgCreateDerivativeLimitOrder, + MsgCreateDerivativeMarketOrder, + MsgCreateSpotLimitOrder, + MsgCreateSpotMarketOrder, + MsgDeposit, + MsgIncreasePositionMargin, + MsgInstantSpotMarketLaunch, + MsgLiquidatePosition, + MsgReclaimLockedFunds, + MsgRewardsOptOut, + MsgSignData, + MsgWithdraw, + MsgExternalTransfer, +} from "@injectivelabs/sdk-ts"; +import * as ExchangeTypes from "../types/exchange"; +import { + StandardResponse, + createSuccessResponse, + createErrorResponse, +} from "../types/index"; + +/** + * Exchange Module Chain GRPC Async Functions with Error Handling + */ + +/** + * Fetches the exchange module parameters. + * + * @this InjectiveGrpcBase + * @param {ExchangeTypes.GetModuleParamsParams} [params] - Optional parameters to filter module parameters. + * @returns {Promise} The standard response containing module parameters or an error. + */ +export async function getModuleParams( + this: InjectiveGrpcBase, + params?: ExchangeTypes.GetModuleParamsParams +): Promise { + try { + const result = await this.chainGrpcExchangeApi.fetchModuleParams(); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getModuleParamsError", err); + } +} + +/** + * Fetches the current state of the exchange module. + * + * @this InjectiveGrpcBase + * @param {ExchangeTypes.GetModuleStateParams} [params] - Optional parameters to filter module state. + * @returns {Promise} The standard response containing module state or an error. + */ +export async function getModuleState( + this: InjectiveGrpcBase, + params?: ExchangeTypes.GetModuleStateParams +): Promise { + try { + const result = await this.chainGrpcExchangeApi.fetchModuleState(); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getModuleStateError", err); + } +} + +/** + * Fetches the fee discount schedule. + * + * @this InjectiveGrpcBase + * @param {ExchangeTypes.GetFeeDiscountScheduleParams} [params] - Optional parameters to filter fee discount schedule. + * @returns {Promise} The standard response containing fee discount schedule or an error. + */ +export async function getFeeDiscountSchedule( + this: InjectiveGrpcBase, + params?: ExchangeTypes.GetFeeDiscountScheduleParams +): Promise { + try { + const result = + await this.chainGrpcExchangeApi.fetchFeeDiscountSchedule(); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getFeeDiscountScheduleError", err); + } +} + +/** + * Fetches the fee discount account information for a specific Injective address. + * + * @this InjectiveGrpcBase + * @param {ExchangeTypes.GetFeeDiscountAccountInfoParams} params - Parameters including the Injective address. + * @returns {Promise} The standard response containing fee discount account info or an error. + */ +export async function getFeeDiscountAccountInfo( + this: InjectiveGrpcBase, + params: ExchangeTypes.GetFeeDiscountAccountInfoParams +): Promise { + try { + const result = + await this.chainGrpcExchangeApi.fetchFeeDiscountAccountInfo( + params.injAddress + ); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getFeeDiscountAccountInfoError", err); + } +} + +/** + * Fetches the trading rewards campaign details. + * + * @this InjectiveGrpcBase + * @param {ExchangeTypes.GetTradingRewardsCampaignParams} [params] - Optional parameters to filter trading rewards campaign. + * @returns {Promise} The standard response containing trading rewards campaign details or an error. + */ +export async function getTradingRewardsCampaign( + this: InjectiveGrpcBase, + params?: ExchangeTypes.GetTradingRewardsCampaignParams +): Promise { + try { + const result = + await this.chainGrpcExchangeApi.fetchTradingRewardsCampaign(); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getTradingRewardsCampaignError", err); + } +} + +/** + * Fetches the trade reward points for specified Injective addresses. + * + * @this InjectiveGrpcBase + * @param {ExchangeTypes.GetTradeRewardPointsParams} params - Parameters including Injective addresses. + * @returns {Promise} The standard response containing trade reward points or an error. + */ +export async function getTradeRewardPoints( + this: InjectiveGrpcBase, + params: ExchangeTypes.GetTradeRewardPointsParams +): Promise { + try { + const result = await this.chainGrpcExchangeApi.fetchTradeRewardPoints( + params.injectiveAddresses + ); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getTradeRewardPointsError", err); + } +} + +/** + * Fetches the pending trade reward points for specified Injective addresses. + * + * @this InjectiveGrpcBase + * @param {ExchangeTypes.GetPendingTradeRewardPointsParams} params - Parameters including Injective addresses. + * @returns {Promise} The standard response containing pending trade reward points or an error. + */ +export async function getPendingTradeRewardPoints( + this: InjectiveGrpcBase, + params: ExchangeTypes.GetPendingTradeRewardPointsParams +): Promise { + try { + const result = + await this.chainGrpcExchangeApi.fetchPendingTradeRewardPoints( + params.injectiveAddresses + ); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getPendingTradeRewardPointsError", err); + } +} + +/** + * Fetches the exchange positions based on provided parameters. + * + * @this InjectiveGrpcBase + * @param {ExchangeTypes.getPositionsParams} [params] - Optional parameters to filter exchange positions. + * @returns {Promise} The standard response containing exchange positions or an error. + */ +export async function getExchangePositions( + this: InjectiveGrpcBase, + params?: ExchangeTypes.GetExchangePositionsParams +): Promise { + try { + const result = await this.chainGrpcExchangeApi.fetchPositions(); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getPositionsError", err); + } +} + +/** + * Fetches the trade nonce for a specific subaccount. + * + * @this InjectiveGrpcBase + * @param {ExchangeTypes.GetSubaccountTradeNonceParams} params - Parameters including the subaccount ID. + * @returns {Promise} The standard response containing trade nonce or an error. + */ +export async function getSubaccountTradeNonce( + this: InjectiveGrpcBase, + params: ExchangeTypes.GetSubaccountTradeNonceParams +): Promise { + try { + const result = + await this.chainGrpcExchangeApi.fetchSubaccountTradeNonce( + params.subaccountId + ); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getSubaccountTradeNonceError", err); + } +} + +/** + * Checks if an account is opted out of rewards. + * + * @this InjectiveGrpcBase + * @param {ExchangeTypes.GetIsOptedOutOfRewardsParams} params - Parameters including the account address. + * @returns {Promise} The standard response indicating opt-out status or an error. + */ +export async function getIsOptedOutOfRewards( + this: InjectiveGrpcBase, + params: ExchangeTypes.GetIsOptedOutOfRewardsParams +): Promise { + try { + const result = await this.chainGrpcExchangeApi.fetchIsOptedOutOfRewards( + params.account + ); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getIsOptedOutOfRewardsError", err); + } +} + +/** + * Fetches all derivative markets. + * + * @this InjectiveGrpcBase + * @param {ExchangeTypes.GetDerivativeMarketsParams} [params] - Optional parameters to filter derivative markets. + * @returns {Promise} The standard response containing derivative markets or an error. + */ +export async function getDerivativeMarkets( + this: InjectiveGrpcBase, + params?: ExchangeTypes.GetDerivativeMarketsParams +): Promise { + try { + const result = await this.indexerGrpcDerivativesApi.fetchMarkets( + params || {} + ); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getDerivativeMarketsError", err); + } +} + +/** + * Fetches a specific derivative market by its ID. + * + * @this InjectiveGrpcBase + * @param {ExchangeTypes.GetDerivativeMarketParams} params - Parameters including the market ID. + * @returns {Promise} The standard response containing derivative market details or an error. + */ +export async function getDerivativeMarket( + this: InjectiveGrpcBase, + params: ExchangeTypes.GetDerivativeMarketParams +): Promise { + try { + const result = await this.indexerGrpcDerivativesApi.fetchMarket( + params.marketId + ); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getDerivativeMarketError", err); + } +} + +/** + * Fetches all binary options markets. + * + * @this InjectiveGrpcBase + * @param {ExchangeTypes.GetBinaryOptionsMarketsParams} [params] - Optional parameters to filter binary options markets. + * @returns {Promise} The standard response containing binary options markets or an error. + */ +export async function getBinaryOptionsMarkets( + this: InjectiveGrpcBase, + params?: ExchangeTypes.GetBinaryOptionsMarketsParams +): Promise { + try { + const result = + await this.indexerGrpcDerivativesApi.fetchBinaryOptionsMarkets( + params || {} + ); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getBinaryOptionsMarketsError", err); + } +} + +/** + * Fetches a specific binary options market by its ID. + * + * @this InjectiveGrpcBase + * @param {ExchangeTypes.GetBinaryOptionsMarketParams} params - Parameters including the market ID. + * @returns {Promise} The standard response containing binary options market details or an error. + */ +export async function getBinaryOptionsMarket( + this: InjectiveGrpcBase, + params: ExchangeTypes.GetBinaryOptionsMarketParams +): Promise { + try { + const result = + await this.indexerGrpcDerivativesApi.fetchBinaryOptionsMarket( + params.marketId + ); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getBinaryOptionsMarketError", err); + } +} + +/** + * Fetches all derivative orders. + * + * @this InjectiveGrpcBase + * @param {ExchangeTypes.GetDerivativeOrdersParams} [params] - Optional parameters to filter derivative orders. + * @returns {Promise} The standard response containing derivative orders or an error. + */ +export async function getDerivativeOrders( + this: InjectiveGrpcBase, + params?: ExchangeTypes.GetDerivativeOrdersParams +): Promise { + try { + const result = await this.indexerGrpcDerivativesApi.fetchOrders( + params || {} + ); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getDerivativeOrdersError", err); + } +} + +/** + * Fetches the history of derivative orders. + * + * @this InjectiveGrpcBase + * @param {ExchangeTypes.GetDerivativeOrderHistoryParams} [params] - Optional parameters to filter derivative order history. + * @returns {Promise} The standard response containing derivative order history or an error. + */ +export async function getDerivativeOrderHistory( + this: InjectiveGrpcBase, + params?: ExchangeTypes.GetDerivativeOrderHistoryParams +): Promise { + try { + const result = await this.indexerGrpcDerivativesApi.fetchOrderHistory( + params || {} + ); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getDerivativeOrderHistoryError", err); + } +} + +/** + * Fetches all positions. + * + * @this InjectiveGrpcBase + * @param {ExchangeTypes.GetPositionsParams} [params] - Optional parameters to filter positions. + * @returns {Promise} The standard response containing positions or an error. + */ +export async function getPositionsList( + this: InjectiveGrpcBase, + params?: ExchangeTypes.GetPositionsParams +): Promise { + try { + const result = await this.indexerGrpcDerivativesApi.fetchPositions( + params || {} + ); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getPositionsListError", err); + } +} + +/** + * Fetches all positions version 2. + * + * @this InjectiveGrpcBase + * @param {ExchangeTypes.GetPositionsV2Params} [params] - Optional parameters to filter positions version 2. + * @returns {Promise} The standard response containing positions version 2 or an error. + */ +export async function getPositionsV2( + this: InjectiveGrpcBase, + params?: ExchangeTypes.GetPositionsV2Params +): Promise { + try { + const result = await this.indexerGrpcDerivativesApi.fetchPositionsV2( + params || {} + ); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getPositionsV2Error", err); + } +} + +/** + * Fetches all derivative trades. + * + * @this InjectiveGrpcBase + * @param {ExchangeTypes.GetDerivativeTradesParams} [params] - Optional parameters to filter derivative trades. + * @returns {Promise} The standard response containing derivative trades or an error. + */ +export async function getDerivativeTrades( + this: InjectiveGrpcBase, + params?: ExchangeTypes.GetDerivativeTradesParams +): Promise { + try { + const result = await this.indexerGrpcDerivativesApi.fetchTrades( + params || {} + ); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getDerivativeTradesError", err); + } +} + +/** + * Fetches all funding payments. + * + * @this InjectiveGrpcBase + * @param {ExchangeTypes.GetFundingPaymentsParams} [params] - Optional parameters to filter funding payments. + * @returns {Promise} The standard response containing funding payments or an error. + */ +export async function getFundingPayments( + this: InjectiveGrpcBase, + params?: ExchangeTypes.GetFundingPaymentsParams +): Promise { + try { + const result = + await this.indexerGrpcDerivativesApi.fetchFundingPayments( + params || {} + ); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getFundingPaymentsError", err); + } +} + +/** + * Fetches all funding rates. + * + * @this InjectiveGrpcBase + * @param {ExchangeTypes.GetFundingRatesParams} [params] - Optional parameters to filter funding rates. + * @returns {Promise} The standard response containing funding rates or an error. + */ +export async function getFundingRates( + this: InjectiveGrpcBase, + params?: ExchangeTypes.GetFundingRatesParams +): Promise { + try { + const result = await this.indexerGrpcDerivativesApi.fetchFundingRates( + params || {} + ); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getFundingRatesError", err); + } +} + +/** + * Fetches the list of derivative subaccount orders. + * + * @this InjectiveGrpcBase + * @param {ExchangeTypes.GetDerivativeSubaccountOrdersListParams} [params] - Optional parameters to filter subaccount orders. + * @returns {Promise} The standard response containing subaccount orders or an error. + */ +export async function getDerivativeSubaccountOrdersList( + this: InjectiveGrpcBase, + params?: ExchangeTypes.GetDerivativeSubaccountOrdersListParams +): Promise { + try { + const result = + await this.indexerGrpcDerivativesApi.fetchSubaccountOrdersList( + params || {} + ); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse( + "getDerivativeSubaccountOrdersListError", + err + ); + } +} + +/** + * Fetches the list of derivative subaccount trades. + * + * @this InjectiveGrpcBase + * @param {ExchangeTypes.GetDerivativeSubaccountTradesListParams} params - Parameters to filter subaccount trades. + * @returns {Promise} The standard response containing subaccount trades or an error. + */ +export async function getDerivativeSubaccountTradesList( + this: InjectiveGrpcBase, + params: ExchangeTypes.GetDerivativeSubaccountTradesListParams +): Promise { + try { + const result = + await this.indexerGrpcDerivativesApi.fetchSubaccountTradesList( + params + ); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse( + "getDerivativeSubaccountTradesListError", + err + ); + } +} + +/** + * Fetches the orderbooks version 2 for specified market IDs. + * + * @this InjectiveGrpcBase + * @param {ExchangeTypes.GetDerivativeOrderbooksV2Params} params - Parameters including market IDs. + * @returns {Promise<{ + * marketId: string; + * orderbook: OrderbookWithSequence; + * }[] | StandardResponse>} The standard response containing orderbooks or an error. + */ +export async function getDerivativeOrderbooksV2( + this: InjectiveGrpcBase, + params: ExchangeTypes.GetDerivativeOrderbooksV2Params +): Promise { + try { + const result = await this.indexerGrpcDerivativesApi.fetchOrderbooksV2( + params.marketIds + ); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getDerivativeOrderbooksV2Error", err); + } +} + +/** + * Fetches the orderbook version 2 for a specific market ID. + * + * @this InjectiveGrpcBase + * @param {ExchangeTypes.GetDerivativeOrderbookV2Params} params - Parameters including the market ID. + * @returns {Promise} The standard response containing the orderbook or an error. + */ +export async function getDerivativeOrderbookV2( + this: InjectiveGrpcBase, + params: ExchangeTypes.GetDerivativeOrderbookV2Params +): Promise { + try { + const result = await this.indexerGrpcDerivativesApi.fetchOrderbookV2( + params.marketId + ); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getDerivativeOrderbookV2Error", err); + } +} + +/** + * Fetches the rewards for specified Injective addresses. + * + * @this InjectiveGrpcBase + * @param {ExchangeTypes.GetRewardsParams} params - Parameters including Injective addresses. + * @returns {Promise} The standard response containing rewards or an error. + */ +export async function getRewards( + this: InjectiveGrpcBase, + params: ExchangeTypes.GetRewardsParams +): Promise { + try { + const result = await this.indexerGrpcAccountApi.fetchRewards(params); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getRewardsError", err); + } +} + +/** + * Fetches the list of subaccounts for a specific address. + * + * @this InjectiveGrpcBase + * @param {ExchangeTypes.GetSubaccountsListParams} params - Parameters including the account address. + * @returns {Promise} The standard response containing subaccounts list or an error. + */ +export async function getSubaccountsList( + this: InjectiveGrpcBase, + params: ExchangeTypes.GetSubaccountsListParams +): Promise { + try { + const result = await this.indexerGrpcAccountApi.fetchSubaccountsList( + params.address + ); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getSubaccountsListError", err); + } +} + +/** + * Fetches the balances list for a specific subaccount. + * + * @this InjectiveGrpcBase + * @param {ExchangeTypes.GetSubaccountBalancesListParams} params - Parameters including the subaccount ID. + * @returns {Promise} The standard response containing subaccount balances list or an error. + */ +export async function getSubaccountBalancesList( + this: InjectiveGrpcBase, + params: ExchangeTypes.GetSubaccountBalancesListParams +): Promise { + try { + const result = + await this.indexerGrpcAccountApi.fetchSubaccountBalancesList( + params.subaccountId + ); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getSubaccountBalancesListError", err); + } +} + +/** + * Fetches the history of a specific subaccount. + * + * @this InjectiveGrpcBase + * @param {ExchangeTypes.GetSubaccountHistoryParams} params - Parameters including subaccount details. + * @returns {Promise} The standard response containing subaccount history or an error. + */ +export async function getSubaccountHistory( + this: InjectiveGrpcBase, + params: ExchangeTypes.GetSubaccountHistoryParams +): Promise { + try { + const result = + await this.indexerGrpcAccountApi.fetchSubaccountHistory(params); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getSubaccountHistoryError", err); + } +} + +/** + * Fetches the order summary for a specific subaccount. + * + * @this InjectiveGrpcBase + * @param {ExchangeTypes.GetSubaccountOrderSummaryParams} params - Parameters including subaccount details. + * @returns {Promise} The standard response containing subaccount order summary or an error. + */ +export async function getSubaccountOrderSummary( + this: InjectiveGrpcBase, + params: ExchangeTypes.GetSubaccountOrderSummaryParams +): Promise { + try { + const result = + await this.indexerGrpcAccountApi.fetchSubaccountOrderSummary( + params + ); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getSubaccountOrderSummaryError", err); + } +} + +/** + * Fetches the states of orders. + * + * @this InjectiveGrpcBase + * @param {ExchangeTypes.GetOrderStatesParams} [params] - Optional parameters to filter order states. + * @returns {Promise} The standard response containing order states or an error. + */ +export async function getOrderStates( + this: InjectiveGrpcBase, + params?: ExchangeTypes.GetOrderStatesParams +): Promise { + try { + const result = await this.indexerGrpcAccountApi.fetchOrderStates( + params || {} + ); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getOrderStatesError", err); + } +} + +/** + * Fetches the account portfolio for a specific address. + * + * @this InjectiveGrpcBase + * @param {ExchangeTypes.GetAccountPortfolioParams} params - Parameters including the account address. + * @returns {Promise} The standard response containing account portfolio or an error. + */ +export async function getAccountPortfolio( + this: InjectiveGrpcBase, + params: ExchangeTypes.GetAccountPortfolioParams +): Promise { + try { + const result = + await this.indexerGrpcAccountPortfolioApi.fetchAccountPortfolio( + params.address + ); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getAccountPortfolioError", err); + } +} + +/** + * Fetches the balances of the account portfolio for a specific address. + * + * @this InjectiveGrpcBase + * @param {ExchangeTypes.GetAccountPortfolioBalancesParams} params - Parameters including the account address. + * @returns {Promise} The standard response containing account portfolio balances or an error. + */ +export async function getAccountPortfolioBalances( + this: InjectiveGrpcBase, + params: ExchangeTypes.GetAccountPortfolioBalancesParams +): Promise { + try { + const result = + await this.indexerGrpcAccountPortfolioApi.fetchAccountPortfolioBalances( + params.address + ); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getAccountPortfolioBalancesError", err); + } +} + +/** + * Fetches all spot markets. + * + * @this InjectiveGrpcBase + * @param {ExchangeTypes.GetSpotMarketsParams} [params] - Optional parameters to filter spot markets. + * @returns {Promise} The standard response containing spot markets or an error. + */ +export async function getSpotMarkets( + this: InjectiveGrpcBase, + params?: ExchangeTypes.GetSpotMarketsParams +): Promise { + try { + const result = await this.indexerGrpcSpotApi.fetchMarkets(params || {}); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getSpotMarketsError", err); + } +} + +/** + * Fetches a specific spot market by its ID. + * + * @this InjectiveGrpcBase + * @param {ExchangeTypes.GetSpotMarketParams} params - Parameters including the market ID. + * @returns {Promise} The standard response containing spot market details or an error. + */ +export async function getSpotMarket( + this: InjectiveGrpcBase, + params: ExchangeTypes.GetSpotMarketParams +): Promise { + try { + const result = await this.indexerGrpcSpotApi.fetchMarket( + params.marketId + ); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getSpotMarketError", err); + } +} + +/** + * Fetches all spot orders. + * + * @this InjectiveGrpcBase + * @param {ExchangeTypes.GetSpotOrdersParams} [params] - Optional parameters to filter spot orders. + * @returns {Promise} The standard response containing spot orders or an error. + */ +export async function getSpotOrders( + this: InjectiveGrpcBase, + params?: ExchangeTypes.GetSpotOrdersParams +): Promise { + try { + const result = await this.indexerGrpcSpotApi.fetchOrders(params || {}); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getSpotOrdersError", err); + } +} + +/** + * Fetches the history of spot orders. + * + * @this InjectiveGrpcBase + * @param {ExchangeTypes.GetSpotOrderHistoryParams} [params] - Optional parameters to filter spot order history. + * @returns {Promise} The standard response containing spot order history or an error. + */ +export async function getSpotOrderHistory( + this: InjectiveGrpcBase, + params?: ExchangeTypes.GetSpotOrderHistoryParams +): Promise { + try { + const result = await this.indexerGrpcSpotApi.fetchOrderHistory( + params || {} + ); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getSpotOrderHistoryError", err); + } +} + +/** + * Fetches all spot trades. + * + * @this InjectiveGrpcBase + * @param {ExchangeTypes.GetSpotTradesParams} [params] - Optional parameters to filter spot trades. + * @returns {Promise} The standard response containing spot trades or an error. + */ +export async function getSpotTrades( + this: InjectiveGrpcBase, + params?: ExchangeTypes.GetSpotTradesParams +): Promise { + try { + const result = await this.indexerGrpcSpotApi.fetchTrades(params || {}); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getSpotTradesError", err); + } +} + +/** + * Fetches the list of spot subaccount orders. + * + * @this InjectiveGrpcBase + * @param {ExchangeTypes.GetSpotSubaccountOrdersListParams} [params] - Optional parameters to filter spot subaccount orders. + * @returns {Promise} The standard response containing spot subaccount orders or an error. + */ +export async function getSpotSubaccountOrdersList( + this: InjectiveGrpcBase, + params?: ExchangeTypes.GetSpotSubaccountOrdersListParams +): Promise { + try { + const result = await this.indexerGrpcSpotApi.fetchSubaccountOrdersList( + params || {} + ); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getSpotSubaccountOrdersListError", err); + } +} + +/** + * Fetches the list of spot subaccount trades. + * + * @this InjectiveGrpcBase + * @param {ExchangeTypes.GetSpotSubaccountTradesListParams} [params] - Optional parameters to filter spot subaccount trades. + * @returns {Promise} The standard response containing spot subaccount trades or an error. + */ +export async function getSpotSubaccountTradesList( + this: InjectiveGrpcBase, + params?: ExchangeTypes.GetSpotSubaccountTradesListParams +): Promise { + try { + const result = await this.indexerGrpcSpotApi.fetchSubaccountTradesList( + params || {} + ); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getSpotSubaccountTradesListError", err); + } +} + +/** + * Fetches the orderbooks version 2 for specified spot market IDs. + * + * @this InjectiveGrpcBase + * @param {ExchangeTypes.GetSpotOrderbooksV2Params} params - Parameters including spot market IDs. + * @returns {Promise} The standard response containing spot orderbooks or an error. + */ +export async function getSpotOrderbooksV2( + this: InjectiveGrpcBase, + params: ExchangeTypes.GetSpotOrderbooksV2Params +): Promise { + try { + const result = await this.indexerGrpcSpotApi.fetchOrderbooksV2( + params.marketIds + ); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getSpotOrderbooksV2Error", err); + } +} + +/** + * Fetches the orderbook version 2 for a specific spot market ID. + * + * @this InjectiveGrpcBase + * @param {ExchangeTypes.GetSpotOrderbookV2Params} params - Parameters including the spot market ID. + * @returns {Promise} The standard response containing the spot orderbook or an error. + */ +export async function getSpotOrderbookV2( + this: InjectiveGrpcBase, + params: ExchangeTypes.GetSpotOrderbookV2Params +): Promise { + try { + const result = await this.indexerGrpcSpotApi.fetchOrderbookV2( + params.marketId + ); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getSpotOrderbookV2Error", err); + } +} + +/** + * Fetches the atomic swap history. + * + * @this InjectiveGrpcBase + * @param {ExchangeTypes.GetAtomicSwapHistoryParams} params - Parameters to filter atomic swap history. + * @returns {Promise} The standard response containing atomic swap history or an error. + */ +export async function getAtomicSwapHistory( + this: InjectiveGrpcBase, + params: ExchangeTypes.GetAtomicSwapHistoryParams +): Promise< + | { + swapHistory: AtomicSwap[]; + pagination: ExchangePagination; + } + | StandardResponse +> { + try { + const result = + await this.indexerGrpcSpotApi.fetchAtomicSwapHistory(params); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getAtomicSwapHistoryError", err); + } +} + +/** + * Fetches all grid strategies. + * + * @this InjectiveGrpcBase + * @param {ExchangeTypes.GetGridStrategiesParams} params - Parameters to filter grid strategies. + * @returns {Promise} The standard response containing grid strategies or an error. + */ +export async function getGridStrategies( + this: InjectiveGrpcBase, + params: ExchangeTypes.GetGridStrategiesParams +): Promise { + try { + const result = + await this.indexerGrpcTradingApi.fetchGridStrategies(params); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getGridStrategiesError", err); + } +} + +/** + * Fetches the historical balance. + * + * @this InjectiveGrpcBase + * @param {ExchangeTypes.GetHistoricalBalanceParams} params - Parameters to filter historical balance. + * @returns {Promise} The standard response containing historical balance or an error. + */ +export async function getHistoricalBalance( + this: InjectiveGrpcBase, + params: ExchangeTypes.GetHistoricalBalanceParams +): Promise { + try { + const result = + await this.indexerGrpcArchiverApi.fetchHistoricalBalance(params); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getHistoricalBalanceError", err); + } +} + +/** + * Fetches the historical realized PnL (Rpnl). + * + * @this InjectiveGrpcBase + * @param {ExchangeTypes.GetHistoricalRpnlParams} params - Parameters to filter historical Rpnl. + * @returns {Promise} The standard response containing historical Rpnl or an error. + */ +export async function getHistoricalRpnl( + this: InjectiveGrpcBase, + params: ExchangeTypes.GetHistoricalRpnlParams +): Promise { + try { + const result = + await this.indexerGrpcArchiverApi.fetchHistoricalRpnl(params); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getHistoricalRpnlError", err); + } +} + +/** + * Fetches the historical trading volumes. + * + * @this InjectiveGrpcBase + * @param {ExchangeTypes.GetHistoricalVolumesParams} params - Parameters to filter historical volumes. + * @returns {Promise} The standard response containing historical volumes or an error. + */ +export async function getHistoricalVolumes( + this: InjectiveGrpcBase, + params: ExchangeTypes.GetHistoricalVolumesParams +): Promise { + try { + const result = + await this.indexerGrpcArchiverApi.fetchHistoricalVolumes(params); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getHistoricalVolumesError", err); + } +} + +/** + * Fetches the PnL leaderboard. + * + * @this InjectiveGrpcBase + * @param {ExchangeTypes.GetPnlLeaderboardParams} params - Parameters to filter PnL leaderboard. + * @returns {Promise} The standard response containing PnL leaderboard or an error. + */ +export async function getPnlLeaderboard( + this: InjectiveGrpcBase, + params: ExchangeTypes.GetPnlLeaderboardParams +): Promise { + try { + const result = + await this.indexerGrpcArchiverApi.fetchPnlLeaderboard(params); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getPnlLeaderboardError", err); + } +} + +/** + * Fetches the volume leaderboard. + * + * @this InjectiveGrpcBase + * @param {ExchangeTypes.GetVolLeaderboardParams} params - Parameters to filter volume leaderboard. + * @returns {Promise} The standard response containing volume leaderboard or an error. + */ +export async function getVolLeaderboard( + this: InjectiveGrpcBase, + params: ExchangeTypes.GetVolLeaderboardParams +): Promise { + try { + const result = + await this.indexerGrpcArchiverApi.fetchVolLeaderboard(params); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getVolLeaderboardError", err); + } +} + +/** + * Fetches the PnL leaderboard with fixed resolution. + * + * @this InjectiveGrpcBase + * @param {ExchangeTypes.GetPnlLeaderboardFixedResolutionParams} params - Parameters to filter PnL leaderboard with fixed resolution. + * @returns {Promise} The standard response containing PnL leaderboard with fixed resolution or an error. + */ +export async function getPnlLeaderboardFixedResolution( + this: InjectiveGrpcBase, + params: ExchangeTypes.GetPnlLeaderboardFixedResolutionParams +): Promise { + try { + const result = + await this.indexerGrpcArchiverApi.fetchPnlLeaderboardFixedResolution( + params + ); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse( + "getPnlLeaderboardFixedResolutionError", + err + ); + } +} + +/** + * Fetches the volume leaderboard with fixed resolution. + * + * @this InjectiveGrpcBase + * @param {ExchangeTypes.GetVolLeaderboardFixedResolutionParams} params - Parameters to filter volume leaderboard with fixed resolution. + * @returns {Promise} The standard response containing volume leaderboard with fixed resolution or an error. + */ +export async function getVolLeaderboardFixedResolution( + this: InjectiveGrpcBase, + params: ExchangeTypes.GetVolLeaderboardFixedResolutionParams +): Promise { + try { + const result = + await this.indexerGrpcArchiverApi.fetchVolLeaderboardFixedResolution( + params + ); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse( + "getVolLeaderboardFixedResolutionError", + err + ); + } +} + +/** + * Fetches the holders of a specific denomination. + * + * @this InjectiveGrpcBase + * @param {ExchangeTypes.GetDenomHoldersParams} params - Parameters including the denomination. + * @returns {Promise} The standard response containing denomination holders or an error. + */ +export async function getDenomHolders( + this: InjectiveGrpcBase, + params: ExchangeTypes.GetDenomHoldersParams +): Promise { + try { + const result = + await this.indexerGrpcArchiverApi.fetchDenomHolders(params); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getDenomHoldersError", err); + } +} + +/** + * Broadcasts a message to update a binary options market as an admin. + * + * @this InjectiveGrpcBase + * @param {ExchangeTypes.MsgAdminUpdateBinaryOptionsMarketParams} params - Parameters to update the binary options market. + * @returns {Promise} The standard response containing the broadcast result or an error. + */ +export async function msgAdminUpdateBinaryOptionsMarket( + this: InjectiveGrpcBase, + params: ExchangeTypes.MsgAdminUpdateBinaryOptionsMarketParams +): Promise { + try { + const msg = MsgAdminUpdateBinaryOptionsMarket.fromJSON({ ...params }); + const result = await this.msgBroadcaster.broadcast({ msgs: msg }); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse( + "msgAdminUpdateBinaryOptionsMarketError", + err + ); + } +} + +/** + * Broadcasts a message to batch cancel binary options orders. + * + * @this InjectiveGrpcBase + * @param {ExchangeTypes.MsgBatchCancelBinaryOptionsOrdersParams} params - Parameters to batch cancel binary options orders. + * @returns {Promise} The standard response containing the broadcast result or an error. + */ +export async function msgBatchCancelBinaryOptionsOrders( + this: InjectiveGrpcBase, + params: ExchangeTypes.MsgBatchCancelBinaryOptionsOrdersParams +): Promise { + try { + const msg = MsgBatchCancelBinaryOptionsOrders.fromJSON({ + ...params, + injectiveAddress: this.injAddress, + }); + const result = await this.msgBroadcaster.broadcast({ msgs: msg }); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse( + "msgBatchCancelBinaryOptionsOrdersError", + err + ); + } +} + +/** + * Broadcasts a message to batch cancel derivative orders. + * + * @this InjectiveGrpcBase + * @param {ExchangeTypes.MsgBatchCancelDerivativeOrdersParams} params - Parameters to batch cancel derivative orders. + * @returns {Promise} The standard response containing the broadcast result or an error. + */ +export async function msgBatchCancelDerivativeOrders( + this: InjectiveGrpcBase, + params: ExchangeTypes.MsgBatchCancelDerivativeOrdersParams +): Promise { + try { + const msg = MsgBatchCancelDerivativeOrders.fromJSON({ + ...params, + injectiveAddress: this.injAddress, + }); + const result = await this.msgBroadcaster.broadcast({ msgs: msg }); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("msgBatchCancelDerivativeOrdersError", err); + } +} + +/** + * Broadcasts a message to batch cancel spot orders. + * + * @this InjectiveGrpcBase + * @param {ExchangeTypes.MsgBatchCancelSpotOrdersParams} params - Parameters to batch cancel spot orders. + * @returns {Promise} The standard response containing the broadcast result or an error. + */ +export async function msgBatchCancelSpotOrders( + this: InjectiveGrpcBase, + params: ExchangeTypes.MsgBatchCancelSpotOrdersParams +): Promise { + try { + const msg = MsgBatchCancelSpotOrders.fromJSON({ + ...params, + injectiveAddress: this.injAddress, + }); + const result = await this.msgBroadcaster.broadcast({ msgs: msg }); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("msgBatchCancelSpotOrdersError", err); + } +} + +/** + * Broadcasts a message to batch update orders. + * + * @this InjectiveGrpcBase + * @param {ExchangeTypes.MsgBatchUpdateOrdersParams} params - Parameters to batch update orders. + * @returns {Promise} The standard response containing the broadcast result or an error. + */ +export async function msgBatchUpdateOrders( + this: InjectiveGrpcBase, + params: ExchangeTypes.MsgBatchUpdateOrdersParams +): Promise { + try { + const msg = MsgBatchUpdateOrders.fromJSON({ + ...params, + injectiveAddress: this.injAddress, + }); + const result = await this.msgBroadcaster.broadcast({ msgs: msg }); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("msgBatchUpdateOrdersError", err); + } +} + +/** + * Broadcasts a message to cancel a binary options order. + * + * @this InjectiveGrpcBase + * @param {ExchangeTypes.MsgCancelBinaryOptionsOrderParams} params - Parameters to cancel a binary options order. + * @returns {Promise} The standard response containing the broadcast result or an error. + */ +export async function msgCancelBinaryOptionsOrder( + this: InjectiveGrpcBase, + params: ExchangeTypes.MsgCancelBinaryOptionsOrderParams +): Promise { + try { + const msg = MsgCancelBinaryOptionsOrder.fromJSON({ + ...params, + injectiveAddress: this.injAddress, + }); + const result = await this.msgBroadcaster.broadcast({ msgs: msg }); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("msgCancelBinaryOptionsOrderError", err); + } +} + +/** + * Broadcasts a message to cancel a derivative order. + * + * @this InjectiveGrpcBase + * @param {ExchangeTypes.MsgCancelDerivativeOrderParams} params - Parameters to cancel a derivative order. + * @returns {Promise} The standard response containing the broadcast result or an error. + */ +export async function msgCancelDerivativeOrder( + this: InjectiveGrpcBase, + params: ExchangeTypes.MsgCancelDerivativeOrderParams +): Promise { + try { + const msg = MsgCancelDerivativeOrder.fromJSON({ + ...params, + injectiveAddress: this.injAddress, + }); + const result = await this.msgBroadcaster.broadcast({ msgs: msg }); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("msgCancelDerivativeOrderError", err); + } +} + +/** + * Broadcasts a message to cancel a spot order. + * + * @this InjectiveGrpcBase + * @param {ExchangeTypes.MsgCancelSpotOrderParams} params - Parameters to cancel a spot order. + * @returns {Promise} The standard response containing the broadcast result or an error. + */ +export async function msgCancelSpotOrder( + this: InjectiveGrpcBase, + params: ExchangeTypes.MsgCancelSpotOrderParams +): Promise { + try { + const msg = MsgCancelSpotOrder.fromJSON({ + ...params, + injectiveAddress: this.injAddress, + }); + const result = await this.msgBroadcaster.broadcast({ msgs: msg }); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("msgCancelSpotOrderError", err); + } +} + +/** + * Broadcasts a message to create a binary options limit order. + * + * @this InjectiveGrpcBase + * @param {ExchangeTypes.MsgCreateBinaryOptionsLimitOrderParams} params - Parameters to create a binary options limit order. + * @returns {Promise} The standard response containing the broadcast result or an error. + */ +export async function msgCreateBinaryOptionsLimitOrder( + this: InjectiveGrpcBase, + params: ExchangeTypes.MsgCreateBinaryOptionsLimitOrderParams +): Promise { + try { + const msg = MsgCreateBinaryOptionsLimitOrder.fromJSON({ + ...params, + injectiveAddress: this.injAddress, + }); + const result = await this.msgBroadcaster.broadcast({ msgs: msg }); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse( + "msgCreateBinaryOptionsLimitOrderError", + err + ); + } +} + +/** + * Broadcasts a message to create a binary options market order. + * + * @this InjectiveGrpcBase + * @param {ExchangeTypes.MsgCreateBinaryOptionsMarketOrderParams} params - Parameters to create a binary options market order. + * @returns {Promise} The standard response containing the broadcast result or an error. + */ +export async function msgCreateBinaryOptionsMarketOrder( + this: InjectiveGrpcBase, + params: ExchangeTypes.MsgCreateBinaryOptionsMarketOrderParams +): Promise { + try { + const msg = MsgCreateBinaryOptionsMarketOrder.fromJSON({ + ...params, + injectiveAddress: this.injAddress, + }); + const result = await this.msgBroadcaster.broadcast({ msgs: msg }); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse( + "msgCreateBinaryOptionsMarketOrderError", + err + ); + } +} + +/** + * Broadcasts a message to create a derivative limit order. + * + * @this InjectiveGrpcBase + * @param {ExchangeTypes.MsgCreateDerivativeLimitOrderParams} params - Parameters to create a derivative limit order. + * @returns {Promise} The standard response containing the broadcast result or an error. + */ +export async function msgCreateDerivativeLimitOrder( + this: InjectiveGrpcBase, + params: ExchangeTypes.MsgCreateDerivativeLimitOrderParams +): Promise { + try { + const msg = MsgCreateDerivativeLimitOrder.fromJSON({ + ...params, + injectiveAddress: this.injAddress, + }); + const result = await this.msgBroadcaster.broadcast({ msgs: msg }); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("msgCreateDerivativeLimitOrderError", err); + } +} + +/** + * Broadcasts a message to create a derivative market order. + * + * @this InjectiveGrpcBase + * @param {ExchangeTypes.MsgCreateDerivativeMarketOrderParams} params - Parameters to create a derivative market order. + * @returns {Promise} The standard response containing the broadcast result or an error. + */ +export async function msgCreateDerivativeMarketOrder( + this: InjectiveGrpcBase, + params: ExchangeTypes.MsgCreateDerivativeMarketOrderParams +): Promise { + try { + const msg = MsgCreateDerivativeMarketOrder.fromJSON({ + ...params, + injectiveAddress: this.injAddress, + }); + const result = await this.msgBroadcaster.broadcast({ msgs: msg }); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("msgCreateDerivativeMarketOrderError", err); + } +} + +/** + * Broadcasts a message to create a spot limit order. + * + * @this InjectiveGrpcBase + * @param {ExchangeTypes.MsgCreateSpotLimitOrderParams} params - Parameters to create a spot limit order. + * @returns {Promise} The standard response containing the broadcast result or an error. + */ +export async function msgCreateSpotLimitOrder( + this: InjectiveGrpcBase, + params: ExchangeTypes.MsgCreateSpotLimitOrderParams +): Promise { + try { + const msg = MsgCreateSpotLimitOrder.fromJSON({ + ...params, + injectiveAddress: this.injAddress, + }); + const result = await this.msgBroadcaster.broadcast({ msgs: msg }); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("msgCreateSpotLimitOrderError", err); + } +} + +/** + * Broadcasts a message to create a spot market order. + * + * @this InjectiveGrpcBase + * @param {ExchangeTypes.MsgCreateSpotMarketOrderParams} params - Parameters to create a spot market order. + * @returns {Promise} The standard response containing the broadcast result or an error. + */ +export async function msgCreateSpotMarketOrder( + this: InjectiveGrpcBase, + params: ExchangeTypes.MsgCreateSpotMarketOrderParams +): Promise { + try { + const msg = MsgCreateSpotMarketOrder.fromJSON({ + ...params, + injectiveAddress: this.injAddress, + }); + const result = await this.msgBroadcaster.broadcast({ msgs: msg }); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("msgCreateSpotMarketOrderError", err); + } +} + +/** + * Broadcasts a message to deposit funds. + * + * @this InjectiveGrpcBase + * @param {ExchangeTypes.MsgDepositParams} params - Parameters to deposit funds. + * @returns {Promise} The standard response containing the broadcast result or an error. + */ +export async function msgDeposit( + this: InjectiveGrpcBase, + params: ExchangeTypes.MsgDepositParams +): Promise { + try { + const msg = MsgDeposit.fromJSON({ + ...params, + injectiveAddress: this.injAddress, + }); + const result = await this.msgBroadcaster.broadcast({ msgs: msg }); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("msgDepositError", err); + } +} + +/** + * Broadcasts a message to perform an external transfer. + * + * @this InjectiveGrpcBase + * @param {ExchangeTypes.MsgExternalTransferParams} params - Parameters to perform an external transfer. + * @returns {Promise} The standard response containing the broadcast result or an error. + */ +export async function msgExternalTransfer( + this: InjectiveGrpcBase, + params: ExchangeTypes.MsgExternalTransferParams +): Promise { + try { + const msg = MsgExternalTransfer.fromJSON({ + ...params, + amount: params.totalAmount, + injectiveAddress: this.injAddress, + }); + const result = await this.msgBroadcaster.broadcast({ msgs: msg }); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("msgExternalTransferError", err); + } +} + +/** + * Broadcasts a message to increase position margin. + * + * @this InjectiveGrpcBase + * @param {ExchangeTypes.MsgIncreasePositionMarginParams} params - Parameters to increase position margin. + * @returns {Promise} The standard response containing the broadcast result or an error. + */ +export async function msgIncreasePositionMargin( + this: InjectiveGrpcBase, + params: ExchangeTypes.MsgIncreasePositionMarginParams +): Promise { + try { + const msg = MsgIncreasePositionMargin.fromJSON({ + ...params, + injectiveAddress: this.injAddress, + }); + const result = await this.msgBroadcaster.broadcast({ msgs: msg }); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("msgIncreasePositionMarginError", err); + } +} + +/** + * Broadcasts a message to instantly launch a spot market. + * + * @this InjectiveGrpcBase + * @param {ExchangeTypes.MsgInstantSpotMarketLaunchParams} params - Parameters to instantly launch a spot market. + * @returns {Promise} The standard response containing the broadcast result or an error. + */ +export async function msgInstantSpotMarketLaunch( + this: InjectiveGrpcBase, + params: ExchangeTypes.MsgInstantSpotMarketLaunchParams +): Promise { + try { + const msg = MsgInstantSpotMarketLaunch.fromJSON({ ...params }); + const result = await this.msgBroadcaster.broadcast({ msgs: msg }); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("msgInstantSpotMarketLaunchError", err); + } +} + +/** + * Broadcasts a message to liquidate a position. + * + * @this InjectiveGrpcBase + * @param {ExchangeTypes.MsgLiquidatePositionParams} params - Parameters to liquidate a position. + * @returns {Promise} The standard response containing the broadcast result or an error. + */ +export async function msgLiquidatePosition( + this: InjectiveGrpcBase, + params: ExchangeTypes.MsgLiquidatePositionParams +): Promise { + try { + const msg = MsgLiquidatePosition.fromJSON({ + ...params, + injectiveAddress: this.injAddress, + }); + const result = await this.msgBroadcaster.broadcast({ msgs: msg }); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("msgLiquidatePositionError", err); + } +} + +/** + * Broadcasts a message to reclaim locked funds. + * + * @this InjectiveGrpcBase + * @param {ExchangeTypes.MsgReclaimLockedFundsParams} params - Parameters to reclaim locked funds. + * @returns {Promise} The standard response containing the broadcast result or an error. + */ +export async function msgReclaimLockedFunds( + this: InjectiveGrpcBase, + params: ExchangeTypes.MsgReclaimLockedFundsParams +): Promise { + try { + const msg = MsgReclaimLockedFunds.fromJSON({ ...params }); + const result = await this.msgBroadcaster.broadcast({ msgs: msg }); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("msgReclaimLockedFundsError", err); + } +} + +/** + * Broadcasts a message to opt out of rewards. + * + * @this InjectiveGrpcBase + * @param {ExchangeTypes.MsgRewardsOptOutParams} params - Parameters to opt out of rewards. + * @returns {Promise} The standard response containing the broadcast result or an error. + */ +export async function msgRewardsOptOut( + this: InjectiveGrpcBase, + params: ExchangeTypes.MsgRewardsOptOutParams +): Promise { + try { + const msg = MsgRewardsOptOut.fromJSON({ ...params }); + const result = await this.msgBroadcaster.broadcast({ msgs: msg }); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("msgRewardsOptOutError", err); + } +} + +/** + * Broadcasts a message to sign data. + * + * @this InjectiveGrpcBase + * @param {ExchangeTypes.MsgSignDataParams} params - Parameters to sign data. + * @returns {Promise} The standard response containing the broadcast result or an error. + */ +export async function msgSignData( + this: InjectiveGrpcBase, + params: ExchangeTypes.MsgSignDataParams +): Promise { + try { + const msg = MsgSignData.fromJSON({ ...params }); + const result = await this.msgBroadcaster.broadcast({ msgs: msg }); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("msgSignDataError", err); + } +} + +/** + * Broadcasts a message to withdraw funds. + * + * @this InjectiveGrpcBase + * @param {ExchangeTypes.MsgWithdrawParams} params - Parameters to withdraw funds. + * @returns {Promise} The standard response containing the broadcast result or an error. + */ +export async function msgWithdraw( + this: InjectiveGrpcBase, + params: ExchangeTypes.MsgWithdrawParams +): Promise { + try { + const msg = MsgWithdraw.fromJSON({ + ...params, + injectiveAddress: this.injAddress, + }); + const result = await this.msgBroadcaster.broadcast({ msgs: msg }); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("msgWithdrawError", err); + } +} diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/modules/explorer.ts b/packages/plugin-injective/injective-sdk-client-ts/src/modules/explorer.ts new file mode 100644 index 00000000000..5464a51d070 --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/modules/explorer.ts @@ -0,0 +1,227 @@ +import { InjectiveGrpcBase } from "../grpc/grpc-base"; +import * as ExplorerTypes from "../types/explorer"; +import { + StandardResponse, + createSuccessResponse, + createErrorResponse, +} from "../types/index"; + +/** + * Explorer Module Chain GRPC Async Functions with Error Handling + */ + +/** + * Fetches a transaction by its hash. + * + * @this InjectiveGrpcBase + * @param {ExplorerTypes.GetTxByHashParams} params - Parameters including the transaction hash. + * @returns {Promise} The standard response containing transaction details or an error. + */ +export async function getTxByHash( + this: InjectiveGrpcBase, + params: ExplorerTypes.GetTxByHashParams +): Promise { + try { + const result = await this.indexerGrpcExplorerApi.fetchTxByHash( + params.hash + ); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getTxByHashError", err); + } +} + +/** + * Fetches transactions for a specific account. + * + * @this InjectiveGrpcBase + * @param {ExplorerTypes.GetAccountTxParams} params - Parameters including account details. + * @returns {Promise} The standard response containing account transactions or an error. + */ +export async function getAccountTx( + this: InjectiveGrpcBase, + params: ExplorerTypes.GetAccountTxParams +): Promise { + try { + const result = await this.indexerGrpcExplorerApi.fetchAccountTx(params); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getAccountTxError", err); + } +} + +/** + * Fetches details of a specific validator. + * + * @this InjectiveGrpcBase + * @param {ExplorerTypes.GetExplorerValidatorParams} params - Parameters including the validator's address. + * @returns {Promise} The standard response containing validator details or an error. + */ +export async function getValidator( + this: InjectiveGrpcBase, + params: ExplorerTypes.GetExplorerValidatorParams +): Promise { + try { + const result = await this.indexerGrpcExplorerApi.fetchValidator( + params.address + ); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getValidatorError", err); + } +} + +/** + * Fetches the uptime of a specific validator. + * + * @this InjectiveGrpcBase + * @param {ExplorerTypes.GetValidatorUptimeParams} params - Parameters including the validator's address. + * @returns {Promise} The standard response indicating validator uptime or an error. + */ +export async function getValidatorUptime( + this: InjectiveGrpcBase, + params: ExplorerTypes.GetValidatorUptimeParams +): Promise { + try { + const result = await this.indexerGrpcExplorerApi.fetchValidatorUptime( + params.validatorAddress + ); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getValidatorUptimeError", err); + } +} + +/** + * Fetches Peggy deposit transactions. + * + * @this InjectiveGrpcBase + * @param {ExplorerTypes.GetPeggyDepositTxsParams} params - Parameters to filter Peggy deposit transactions. + * @returns {Promise} The standard response containing Peggy deposit transactions or an error. + */ +export async function getPeggyDepositTxs( + this: InjectiveGrpcBase, + params: ExplorerTypes.GetPeggyDepositTxsParams +): Promise { + try { + const result = + await this.indexerGrpcExplorerApi.fetchPeggyDepositTxs(params); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getPeggyDepositTxsError", err); + } +} + +/** + * Fetches Peggy withdrawal transactions. + * + * @this InjectiveGrpcBase + * @param {ExplorerTypes.GetPeggyWithdrawalTxsParams} params - Parameters to filter Peggy withdrawal transactions. + * @returns {Promise} The standard response containing Peggy withdrawal transactions or an error. + */ +export async function getPeggyWithdrawalTxs( + this: InjectiveGrpcBase, + params: ExplorerTypes.GetPeggyWithdrawalTxsParams +): Promise { + try { + const result = + await this.indexerGrpcExplorerApi.fetchPeggyWithdrawalTxs(params); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getPeggyWithdrawalTxsError", err); + } +} + +/** + * Fetches a list of blocks based on provided parameters. + * + * @this InjectiveGrpcBase + * @param {ExplorerTypes.GetBlocksParams} params - Parameters to filter blocks. + * @returns {Promise} The standard response containing blocks or an error. + */ +export async function getBlocks( + this: InjectiveGrpcBase, + params: ExplorerTypes.GetBlocksParams +): Promise { + try { + const result = await this.indexerGrpcExplorerApi.fetchBlocks(params); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getBlocksError", err); + } +} + +/** + * Fetches details of a specific block by its ID. + * + * @this InjectiveGrpcBase + * @param {ExplorerTypes.GetBlockParams} params - Parameters including the block ID. + * @returns {Promise} The standard response containing block details or an error. + */ +export async function getBlock( + this: InjectiveGrpcBase, + params: ExplorerTypes.GetBlockParams +): Promise { + try { + const result = await this.indexerGrpcExplorerApi.fetchBlock(params.id); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getBlockError", err); + } +} + +/** + * Fetches a list of transactions based on provided parameters. + * + * @this InjectiveGrpcBase + * @param {ExplorerTypes.GetTxsParams} params - Parameters to filter transactions. + * @returns {Promise} The standard response containing transactions or an error. + */ +export async function getTxs( + this: InjectiveGrpcBase, + params: ExplorerTypes.GetTxsParams +): Promise { + try { + const result = await this.indexerGrpcExplorerApi.fetchTxs(params); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getTxsError", err); + } +} + +/** + * Fetches IBC transfer transactions based on provided parameters. + * + * @this InjectiveGrpcBase + * @param {ExplorerTypes.GetIBCTransferTxsParams} params - Parameters to filter IBC transfer transactions. + * @returns {Promise} The standard response containing IBC transfer transactions or an error. + */ +export async function getIBCTransferTxs( + this: InjectiveGrpcBase, + params: ExplorerTypes.GetIBCTransferTxsParams +): Promise { + try { + const result = + await this.indexerGrpcExplorerApi.fetchIBCTransferTxs(params); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getIBCTransferTxsError", err); + } +} + +/** + * Fetches explorer statistics. + * + * @this InjectiveGrpcBase + * @returns {Promise} The standard response containing explorer statistics or an error. + */ +export async function getExplorerStats( + this: InjectiveGrpcBase +): Promise { + try { + const result = await this.indexerGrpcExplorerApi.fetchExplorerStats(); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getStatsError", err); + } +} diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/modules/gov.ts b/packages/plugin-injective/injective-sdk-client-ts/src/modules/gov.ts new file mode 100644 index 00000000000..06ea77fc279 --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/modules/gov.ts @@ -0,0 +1,350 @@ +import { InjectiveGrpcBase } from "../grpc/grpc-base"; +import { + MsgSubmitProposalExpiryFuturesMarketLaunch, + MsgSubmitProposalSpotMarketLaunch, + MsgSubmitProposalPerpetualMarketLaunch, + MsgVote, + MsgSubmitTextProposal, + MsgSubmitProposalSpotMarketParamUpdate, + MsgSubmitGenericProposal, + MsgGovDeposit, + TxResponse, +} from "@injectivelabs/sdk-ts"; +import * as GovernanceTypes from "../types/gov"; +import { + StandardResponse, + createSuccessResponse, + createErrorResponse, +} from "../types/index"; + +/** + * Governance Module Chain GRPC Async Functions with Error Handling + */ + +/** + * Fetches the governance module parameters. + * + * @this InjectiveGrpcBase + * @returns {Promise} The standard response containing governance module parameters or an error. + */ +export async function getGovernanceModuleParams( + this: InjectiveGrpcBase +): Promise { + try { + const result = await this.chainGrpcGovApi.fetchModuleParams(); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getModuleParamsError", err); + } +} + +/** + * Fetches a list of proposals based on provided parameters. + * + * @this InjectiveGrpcBase + * @param {GovernanceTypes.GetProposalsParams} params - Parameters to filter proposals. + * @returns {Promise} The standard response containing a list of proposals or an error. + */ +export async function getProposals( + this: InjectiveGrpcBase, + params: GovernanceTypes.GetProposalsParams +): Promise { + try { + const result = await this.chainGrpcGovApi.fetchProposals(params); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getProposalsError", err); + } +} + +/** + * Fetches details of a specific proposal by its ID. + * + * @this InjectiveGrpcBase + * @param {GovernanceTypes.GetProposalParams} params - Parameters including the proposal ID. + * @returns {Promise} The standard response containing proposal details or an error. + */ +export async function getProposal( + this: InjectiveGrpcBase, + params: GovernanceTypes.GetProposalParams +): Promise { + try { + const result = await this.chainGrpcGovApi.fetchProposal( + params.proposalId + ); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getProposalError", err); + } +} + +/** + * Fetches deposits for a specific proposal. + * + * @this InjectiveGrpcBase + * @param {GovernanceTypes.GetProposalDepositsParams} params - Parameters including the proposal ID. + * @returns {Promise} The standard response containing proposal deposits or an error. + */ +export async function getProposalDeposits( + this: InjectiveGrpcBase, + params: GovernanceTypes.GetProposalDepositsParams +): Promise { + try { + const result = await this.chainGrpcGovApi.fetchProposalDeposits(params); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getProposalDepositsError", err); + } +} + +/** + * Fetches votes for a specific proposal. + * + * @this InjectiveGrpcBase + * @param {GovernanceTypes.GetProposalVotesParams} params - Parameters including the proposal ID. + * @returns {Promise} The standard response containing proposal votes or an error. + */ +export async function getProposalVotes( + this: InjectiveGrpcBase, + params: GovernanceTypes.GetProposalVotesParams +): Promise { + try { + const result = await this.chainGrpcGovApi.fetchProposalVotes(params); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getProposalVotesError", err); + } +} + +/** + * Fetches the tally results of a specific proposal. + * + * @this InjectiveGrpcBase + * @param {GovernanceTypes.GetProposalTallyParams} params - Parameters including the proposal ID. + * @returns {Promise} The standard response containing proposal tally or an error. + */ +export async function getProposalTally( + this: InjectiveGrpcBase, + params: GovernanceTypes.GetProposalTallyParams +): Promise { + try { + const result = await this.chainGrpcGovApi.fetchProposalTally( + params.proposalId + ); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getProposalTallyError", err); + } +} + +/** + * Submits a proposal to launch an expiry futures market. + * + * @this InjectiveGrpcBase + * @param {GovernanceTypes.MsgSubmitProposalExpiryFuturesMarketLaunchParams} params - Parameters to submit the proposal. + * @returns {Promise} The standard response containing the transaction result or an error. + */ +export async function msgSubmitProposalExpiryFuturesMarketLaunch( + this: InjectiveGrpcBase, + params: GovernanceTypes.MsgSubmitProposalExpiryFuturesMarketLaunchParams +): Promise { + try { + const msg = MsgSubmitProposalExpiryFuturesMarketLaunch.fromJSON({ + ...params, + proposer: this.injAddress, + }); + const result: TxResponse = await this.msgBroadcaster.broadcast({ + msgs: msg, + }); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse( + "msgSubmitProposalExpiryFuturesMarketLaunchError", + err + ); + } +} + +/** + * Submits a proposal to launch a spot market. + * + * @this InjectiveGrpcBase + * @param {GovernanceTypes.MsgSubmitProposalSpotMarketLaunchParams} params - Parameters to submit the proposal. + * @returns {Promise} The standard response containing the transaction result or an error. + */ +export async function msgSubmitProposalSpotMarketLaunch( + this: InjectiveGrpcBase, + params: GovernanceTypes.MsgSubmitProposalSpotMarketLaunchParams +): Promise { + try { + const msg = MsgSubmitProposalSpotMarketLaunch.fromJSON({ + ...params, + proposer: this.injAddress, + }); + const result: TxResponse = await this.msgBroadcaster.broadcast({ + msgs: msg, + }); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse( + "msgSubmitProposalSpotMarketLaunchError", + err + ); + } +} + +/** + * Submits a proposal to launch a perpetual market. + * + * @this InjectiveGrpcBase + * @param {GovernanceTypes.MsgSubmitProposalPerpetualMarketLaunchParams} params - Parameters to submit the proposal. + * @returns {Promise} The standard response containing the transaction result or an error. + */ +export async function msgSubmitProposalPerpetualMarketLaunch( + this: InjectiveGrpcBase, + params: GovernanceTypes.MsgSubmitProposalPerpetualMarketLaunchParams +): Promise { + try { + const msg = MsgSubmitProposalPerpetualMarketLaunch.fromJSON({ + ...params, + proposer: this.injAddress, + }); + const result: TxResponse = await this.msgBroadcaster.broadcast({ + msgs: msg, + }); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse( + "msgSubmitProposalPerpetualMarketLaunchError", + err + ); + } +} + +/** + * Casts a vote on a specific proposal. + * + * @this InjectiveGrpcBase + * @param {GovernanceTypes.MsgVoteParams} params - Parameters to cast the vote. + * @returns {Promise} The standard response containing the transaction result or an error. + */ +export async function msgVote( + this: InjectiveGrpcBase, + params: GovernanceTypes.MsgVoteParams +): Promise { + try { + const msg = MsgVote.fromJSON({ + ...params, + voter: this.injAddress, + }); + const result: TxResponse = await this.msgBroadcaster.broadcast({ + msgs: msg, + }); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("msgVoteError", err); + } +} + +/** + * Submits a text-based proposal. + * + * @this InjectiveGrpcBase + * @param {GovernanceTypes.MsgSubmitTextProposalParams} params - Parameters to submit the text proposal. + * @returns {Promise} The standard response containing the transaction result or an error. + */ +export async function msgSubmitTextProposal( + this: InjectiveGrpcBase, + params: GovernanceTypes.MsgSubmitTextProposalParams +): Promise { + try { + const msg = MsgSubmitTextProposal.fromJSON({ + ...params, + proposer: this.injAddress, + }); + const result: TxResponse = await this.msgBroadcaster.broadcast({ + msgs: msg, + }); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("msgSubmitTextProposalError", err); + } +} + +/** + * Submits a proposal to update spot market parameters. + * + * @this InjectiveGrpcBase + * @param {GovernanceTypes.MsgSubmitProposalSpotMarketParamUpdateParams} params - Parameters to submit the proposal. + * @returns {Promise} The standard response containing the transaction result or an error. + */ +export async function msgSubmitProposalSpotMarketParamUpdate( + this: InjectiveGrpcBase, + params: GovernanceTypes.MsgSubmitProposalSpotMarketParamUpdateParams +): Promise { + try { + const msg = MsgSubmitProposalSpotMarketParamUpdate.fromJSON({ + ...params, + proposer: this.injAddress, + }); + const result: TxResponse = await this.msgBroadcaster.broadcast({ + msgs: msg, + }); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse( + "msgSubmitProposalSpotMarketParamUpdateError", + err + ); + } +} + +/** + * Submits a generic proposal. + * + * @this InjectiveGrpcBase + * @param {GovernanceTypes.MsgSubmitGenericProposalParams} params - Parameters to submit the generic proposal. + * @returns {Promise} The standard response containing the transaction result or an error. + */ +export async function msgSubmitGenericProposal( + this: InjectiveGrpcBase, + params: GovernanceTypes.MsgSubmitGenericProposalParams +): Promise { + try { + const msg = MsgSubmitGenericProposal.fromJSON({ + ...params, + proposer: this.injAddress, + }); + const result: TxResponse = await this.msgBroadcaster.broadcast({ + msgs: msg, + }); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("msgSubmitGenericProposalError", err); + } +} + +/** + * Deposits tokens to a specific proposal. + * + * @this InjectiveGrpcBase + * @param {GovernanceTypes.MsgGovDepositParams} params - Parameters to deposit tokens to a proposal. + * @returns {Promise} The standard response containing the transaction result or an error. + */ +export async function msgGovDeposit( + this: InjectiveGrpcBase, + params: GovernanceTypes.MsgGovDepositParams +): Promise { + try { + const msg = MsgGovDeposit.fromJSON({ + ...params, + depositor: this.injAddress, + }); + const result: TxResponse = await this.msgBroadcaster.broadcast({ + msgs: msg, + }); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("msgDepositError", err); + } +} diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/modules/index.ts b/packages/plugin-injective/injective-sdk-client-ts/src/modules/index.ts new file mode 100644 index 00000000000..446d888ee7e --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/modules/index.ts @@ -0,0 +1,408 @@ +import { InjectiveGrpcBase } from "../grpc/grpc-base"; +import { Network } from "@injectivelabs/networks"; + +import * as AuctionModule from "./auction"; +import * as AuthModule from "./auth"; +import * as AuthZModule from "./authz"; +import * as BankModule from "./bank"; +import * as DistributionModule from "./distribution"; +import * as ExchangeModule from "./exchange"; +import * as GovernanceModule from "./gov"; +import * as IbcModule from "./Ibc"; +import * as InsuranceFundModule from "./insurance"; +import * as MintModule from "./mint"; +import * as MitoModule from "./mito"; +import * as ExplorerModule from "./explorer"; +import * as OracleModule from "./oracle"; +import * as PeggyModule from "./peggy"; +import * as PermissionsModule from "./permissions"; +import * as StakingModule from "./staking"; +import * as TokenFactoryModule from "./token-factory"; +import * as WasmModule from "./wasm"; +import * as WasmXModule from "./wasmx"; + +export class InjectiveGrpcClient extends InjectiveGrpcBase { + constructor( + networkType: keyof typeof Network = "Mainnet", + injectivePrivateKey: string, + ethPublicKey?: string, + injPublicKey?: string + ) { + if (!ethPublicKey && !injPublicKey) { + throw new Error("Either eth or inj public key is required"); + } + super(networkType, injectivePrivateKey, ethPublicKey, injPublicKey); + console.log("InjectiveGrpcClient constructor init"); + } + // Auction endpoints + public getAuctionModuleParams = + AuctionModule.getAuctionModuleParams.bind(this); + public getAuctionModuleState = + AuctionModule.getAuctionModuleState.bind(this); + public getCurrentBasket = AuctionModule.getCurrentBasket.bind(this); + public getAuctionRound = AuctionModule.getAuctionRound.bind(this); + public getAuctions = AuctionModule.getAuctions.bind(this); + + //Auth endpoints + public getAuthModuleParams = AuthModule.getAuthModuleParams.bind(this); + public getAccountDetails = AuthModule.getAccountDetails.bind(this); + public getAccounts = AuthModule.getAccounts.bind(this); + + //Authz endpoints + public getGrants = AuthZModule.getGrants.bind(this); + public getGranterGrants = AuthZModule.getGranterGrants.bind(this); + public getGranteeGrants = AuthZModule.getGranteeGrants.bind(this); + + //Bank endpoints + public getBankModuleParams = BankModule.getBankModuleParams.bind(this); + public getBankBalance = BankModule.getBankBalance.bind(this); + public getTotalSupply = BankModule.getTotalSupply.bind(this); + public getAllTotalSupply = BankModule.getAllTotalSupply.bind(this); + public getSupplyOf = BankModule.getSupplyOf.bind(this); + public getDenomsMetadata = BankModule.getDenomsMetadata.bind(this); + public getDenomMetadata = BankModule.getDenomMetadata.bind(this); + public getDenomOwners = BankModule.getDenomOwners.bind(this); + + //Distribution endpoints + public getDistributionModuleParams = + DistributionModule.getDistributionModuleParams.bind(this); + public getDelegatorRewardsForValidator = + DistributionModule.getDelegatorRewardsForValidator.bind(this); + public getDelegatorRewardsForValidatorNoThrow = + DistributionModule.getDelegatorRewardsForValidatorNoThrow.bind(this); + public getDelegatorRewards = + DistributionModule.getDelegatorRewards.bind(this); + public getDelegatorRewardsNoThrow = + DistributionModule.getDelegatorRewardsNoThrow.bind(this); + + //Exchange endpoints + //============================CHAIN=============================== + public getModuleParams = ExchangeModule.getModuleParams.bind(this); + public getModuleState = ExchangeModule.getModuleState.bind(this); + public getFeeDiscountSchedule = + ExchangeModule.getFeeDiscountSchedule.bind(this); + public getFeeDiscountAccountInfo = + ExchangeModule.getFeeDiscountAccountInfo.bind(this); + public getTradingRewardsCampaign = + ExchangeModule.getTradingRewardsCampaign.bind(this); + public getTradeRewardPoints = + ExchangeModule.getTradeRewardPoints.bind(this); + public getPendingTradeRewardPoints = + ExchangeModule.getPendingTradeRewardPoints.bind(this); + public getExchangePositions = + ExchangeModule.getExchangePositions.bind(this); + public getSubaccountTradeNonce = + ExchangeModule.getSubaccountTradeNonce.bind(this); + public getIsOptedOutOfRewards = + ExchangeModule.getIsOptedOutOfRewards.bind(this); + //===========================INDEXER============================== + public getDerivativeMarkets = + ExchangeModule.getDerivativeMarkets.bind(this); + public getDerivativeMarket = ExchangeModule.getDerivativeMarket.bind(this); + public getBinaryOptionsMarkets = + ExchangeModule.getBinaryOptionsMarkets.bind(this); + public getBinaryOptionsMarket = + ExchangeModule.getBinaryOptionsMarket.bind(this); + public getDerivativeOrders = ExchangeModule.getDerivativeOrders.bind(this); + public getDerivativeOrderHistory = + ExchangeModule.getDerivativeOrderHistory.bind(this); + public getPositionsV2 = ExchangeModule.getPositionsV2.bind(this); + public getDerivativeTrades = ExchangeModule.getDerivativeTrades.bind(this); + public getFundingPayments = ExchangeModule.getFundingPayments.bind(this); + public getFundingRates = ExchangeModule.getFundingRates.bind(this); + public getDerivativeSubaccountOrdersList = + ExchangeModule.getDerivativeSubaccountOrdersList.bind(this); + public getDerivativeSubaccountTradesList = + ExchangeModule.getDerivativeSubaccountTradesList.bind(this); + public getDerivativeOrderbooksV2 = + ExchangeModule.getDerivativeOrderbooksV2.bind(this); + public getDerivativeOrderbookV2 = + ExchangeModule.getDerivativeOrderbookV2.bind(this); + public getRewards = ExchangeModule.getRewards.bind(this); + public getSubaccountsList = ExchangeModule.getSubaccountsList.bind(this); + public getSubaccountBalancesList = + ExchangeModule.getSubaccountBalancesList.bind(this); + public getSubaccountHistory = + ExchangeModule.getSubaccountHistory.bind(this); + public getSubaccountOrderSummary = + ExchangeModule.getSubaccountOrderSummary.bind(this); + public getOrderStates = ExchangeModule.getOrderStates.bind(this); + public getAccountPortfolio = ExchangeModule.getAccountPortfolio.bind(this); + public getAccountPortfolioBalances = + ExchangeModule.getAccountPortfolioBalances.bind(this); + public getSpotMarkets = ExchangeModule.getSpotMarkets.bind(this); + public getSpotMarket = ExchangeModule.getSpotMarket.bind(this); + public getSpotOrders = ExchangeModule.getSpotOrders.bind(this); + public getSpotOrderHistory = ExchangeModule.getSpotOrderHistory.bind(this); + public getSpotTrades = ExchangeModule.getSpotTrades.bind(this); + public getSpotSubaccountOrdersList = + ExchangeModule.getSpotSubaccountOrdersList.bind(this); + public getSpotSubaccountTradesList = + ExchangeModule.getSpotSubaccountTradesList.bind(this); + public getSpotOrderbooksV2 = ExchangeModule.getSpotOrderbooksV2.bind(this); + public getSpotOrderbookV2 = ExchangeModule.getSpotOrderbookV2.bind(this); + public getAtomicSwapHistory = + ExchangeModule.getAtomicSwapHistory.bind(this); + public getGridStrategies = ExchangeModule.getGridStrategies.bind(this); + public getHistoricalBalance = + ExchangeModule.getHistoricalBalance.bind(this); + public getHistoricalRpnl = ExchangeModule.getHistoricalRpnl.bind(this); + public getHistoricalVolumes = + ExchangeModule.getHistoricalVolumes.bind(this); + public getPnlLeaderboard = ExchangeModule.getPnlLeaderboard.bind(this); + public getVolLeaderboard = ExchangeModule.getVolLeaderboard.bind(this); + public getPnlLeaderboardFixedResolution = + ExchangeModule.getPnlLeaderboardFixedResolution.bind(this); + public getVolLeaderboardFixedResolution = + ExchangeModule.getVolLeaderboardFixedResolution.bind(this); + public getDenomHolders = ExchangeModule.getDenomHolders.bind(this); + //Governance functions + public getGovernanceModuleParams = + GovernanceModule.getGovernanceModuleParams.bind(this); + public getProposals = GovernanceModule.getProposals.bind(this); + public getProposal = GovernanceModule.getProposal.bind(this); + public getProposalDeposits = + GovernanceModule.getProposalDeposits.bind(this); + public getProposalVotes = GovernanceModule.getProposalVotes.bind(this); + public getProposalTally = GovernanceModule.getProposalTally.bind(this); + //ibc functions + public getDenomTrace = IbcModule.getDenomTrace.bind(this); + public getDenomsTrace = IbcModule.getDenomsTrace.bind(this); + //Insurance functions + public getInsuranceModuleParams = + InsuranceFundModule.getInsuranceModuleParams.bind(this); + public getInsuranceFunds = InsuranceFundModule.getInsuranceFunds.bind(this); + public getInsuranceFund = InsuranceFundModule.getInsuranceFund.bind(this); + public getInsuranceFundDeposits = + InsuranceFundModule.getEstimatedRedemptions.bind(this); + public getInsuranceFundRedemptions = + InsuranceFundModule.getPendingRedemptions.bind(this); + //Mint functions + public getMintModuleParams = MintModule.getMintModuleParams.bind(this); + public getInflation = MintModule.getInflation.bind(this); + public getAnnualProvisions = MintModule.getAnnualProvisions.bind(this); + //Mito functions + public getVault = MitoModule.getVault.bind(this); + public getVaults = MitoModule.getVaults.bind(this); + public getLpTokenPriceChart = MitoModule.getLpTokenPriceChart.bind(this); + public getTVLChart = MitoModule.getTVLChart.bind(this); + public getVaultsByHolderAddress = + MitoModule.getVaultsByHolderAddress.bind(this); + public getLPHolders = MitoModule.getLPHolders.bind(this); + public getHolderPortfolio = MitoModule.getHolderPortfolio.bind(this); + public getLeaderboard = MitoModule.getLeaderboard.bind(this); + public getTransferHistory = MitoModule.getTransferHistory.bind(this); + public getLeaderboardEpochs = MitoModule.getLeaderboardEpochs.bind(this); + public getStakingPools = MitoModule.getStakingPools.bind(this); + public getStakingHistory = MitoModule.getStakingHistory.bind(this); + public getStakingRewardsByAccount = + MitoModule.getStakingRewardsByAccount.bind(this); + public getMissions = MitoModule.getMissions.bind(this); + public getMissionLeaderboard = MitoModule.getMissionLeaderboard.bind(this); + public getIDO = MitoModule.getIDO.bind(this); + public getIDOs = MitoModule.getIDOs.bind(this); + public getIDOSubscribers = MitoModule.getIDOSubscribers.bind(this); + public getIDOSubscription = MitoModule.getIDOSubscription.bind(this); + public getIDOActivities = MitoModule.getIDOActivities.bind(this); + public getIDOWhitelist = MitoModule.getIDOWhitelist.bind(this); + public getClaimReferences = MitoModule.getClaimReferences.bind(this); + //Oracle functions + public getOracleModuleParams = + OracleModule.getOracleModuleParams.bind(this); + //Peggy functions + public getPeggyModuleParams = PeggyModule.getPeggyModuleParams.bind(this); + //Permissions functions + public getAddressesByRole = PermissionsModule.getAddressesByRole.bind(this); + public getAddressRoles = PermissionsModule.getAddressRoles.bind(this); + public getAllNamespaces = PermissionsModule.getAllNamespaces.bind(this); + public getPermissionsModuleParams = + PermissionsModule.getPermissionsModuleParams.bind(this); + public getNamespaceByDenom = + PermissionsModule.getNamespaceByDenom.bind(this); + public getVouchersForAddress = + PermissionsModule.getVouchersForAddress.bind(this); + //Staking functions + public getStakingModuleParams = + StakingModule.getStakingModuleParams.bind(this); + public getPool = StakingModule.getPool.bind(this); + public getValidators = StakingModule.getValidators.bind(this); + public getStakingValidator = StakingModule.getValidator.bind(this); + public getValidatorDelegations = + StakingModule.getValidatorDelegations.bind(this); + public getValidatorDelegationsNoThrow = + StakingModule.getValidatorDelegationsNoThrow.bind(this); + public getValidatorUnbondingDelegations = + StakingModule.getValidatorUnbondingDelegations.bind(this); + public getValidatorUnbondingDelegationsNoThrow = + StakingModule.getValidatorUnbondingDelegationsNoThrow.bind(this); + public getDelegation = StakingModule.getDelegation.bind(this); + public getDelegations = StakingModule.getDelegations.bind(this); + public getDelegationsNoThrow = + StakingModule.getDelegationsNoThrow.bind(this); + public getDelegators = StakingModule.getDelegators.bind(this); + public getDelegatorsNoThrow = StakingModule.getDelegatorsNoThrow.bind(this); + public getUnbondingDelegations = + StakingModule.getUnbondingDelegations.bind(this); + public getUnbondingDelegationsNoThrow = + StakingModule.getUnbondingDelegationsNoThrow.bind(this); + public getReDelegations = StakingModule.getReDelegations.bind(this); + public getReDelegationsNoThrow = + StakingModule.getReDelegationsNoThrow.bind(this); + //Token Factory functions + public getDenomsFromCreator = + TokenFactoryModule.getDenomsFromCreator.bind(this); + public getDenomAuthorityMetadata = + TokenFactoryModule.getDenomAuthorityMetadata.bind(this); + public getTokenFactoryModuleParams = + TokenFactoryModule.getTokenFactoryModuleParams.bind(this); + public getTokenFactoryModuleState = + TokenFactoryModule.getTokenFactoryModuleState.bind(this); + //Wasm contract functions + public getContractAccountsBalance = + WasmModule.getContractAccountsBalance.bind(this); + public getContractState = WasmModule.getContractState.bind(this); + public getContractInfo = WasmModule.getContractInfo.bind(this); + public getContractHistory = WasmModule.getContractHistory.bind(this); + public getSmartContractState = WasmModule.getSmartContractState.bind(this); + public getRawContractState = WasmModule.getRawContractState.bind(this); + public getContractCodes = WasmModule.getContractCodes.bind(this); + public getContractCode = WasmModule.getContractCode.bind(this); + public getContractCodeContracts = + WasmModule.getContractCodeContracts.bind(this); + //Wasmx functions + public getWasmxModuleParams = WasmXModule.getWasmxModuleParams.bind(this); + public getWasmxWasmModuleState = WasmXModule.getWasmxModuleState.bind(this); + //Explorer functions + //===========================INDEXER============================== + public getTxByHash = ExplorerModule.getTxByHash.bind(this); + public getAccountTx = ExplorerModule.getAccountTx.bind(this); + public getExplorerValidator = ExplorerModule.getValidator.bind(this); + public getValidatorUptime = ExplorerModule.getValidatorUptime.bind(this); + public getPeggyDepositTxs = ExplorerModule.getPeggyDepositTxs.bind(this); + public getPeggyWithdrawalTxs = + ExplorerModule.getPeggyWithdrawalTxs.bind(this); + public getBlocks = ExplorerModule.getBlocks.bind(this); + public getBlock = ExplorerModule.getBlock.bind(this); + public getTxs = ExplorerModule.getTxs.bind(this); + public getIBCTransferTxs = ExplorerModule.getIBCTransferTxs.bind(this); + public getExplorerStats = ExplorerModule.getExplorerStats.bind(this); + + // Messages Broadcasting endpoints + // Auction message functions + public msgBid = AuctionModule.msgBid.bind(this); + + // AuthZ message functions + public msgGrant = AuthZModule.msgGrant.bind(this); + public msgExec = AuthZModule.msgExec.bind(this); + public msgRevoke = AuthZModule.msgRevoke.bind(this); + + // Bank message functions + public msgSend = BankModule.msgSend.bind(this); + public msgMultiSend = BankModule.msgMultiSend.bind(this); + + // Distribution message functions + public msgWithdrawDelegatorReward = + DistributionModule.msgWithdrawDelegatorReward.bind(this); + public msgWithdrawValidatorCommission = + DistributionModule.msgWithdrawValidatorCommission.bind(this); + + // Exchange message functions + public msgAdminUpdateBinaryOptionsMarket = + ExchangeModule.msgAdminUpdateBinaryOptionsMarket.bind(this); + public msgBatchCancelBinaryOptionsOrders = + ExchangeModule.msgBatchCancelBinaryOptionsOrders.bind(this); + public msgBatchCancelDerivativeOrders = + ExchangeModule.msgBatchCancelDerivativeOrders.bind(this); + public msgBatchCancelSpotOrders = + ExchangeModule.msgBatchCancelSpotOrders.bind(this); + public msgBatchUpdateOrders = + ExchangeModule.msgBatchUpdateOrders.bind(this); + public msgCancelBinaryOptionsOrder = + ExchangeModule.msgCancelBinaryOptionsOrder.bind(this); + public msgCancelDerivativeOrder = + ExchangeModule.msgCancelDerivativeOrder.bind(this); + public msgCancelSpotOrder = ExchangeModule.msgCancelSpotOrder.bind(this); + public msgCreateBinaryOptionsLimitOrder = + ExchangeModule.msgCreateBinaryOptionsLimitOrder.bind(this); + public msgCreateBinaryOptionsMarketOrder = + ExchangeModule.msgCreateBinaryOptionsMarketOrder.bind(this); + public msgCreateDerivativeLimitOrder = + ExchangeModule.msgCreateDerivativeLimitOrder.bind(this); + public msgCreateDerivativeMarketOrder = + ExchangeModule.msgCreateDerivativeMarketOrder.bind(this); + public msgCreateSpotLimitOrder = + ExchangeModule.msgCreateSpotLimitOrder.bind(this); + public msgCreateSpotMarketOrder = + ExchangeModule.msgCreateSpotMarketOrder.bind(this); + public msgDeposit = ExchangeModule.msgDeposit.bind(this); + public msgExternalTransfer = ExchangeModule.msgExternalTransfer.bind(this); + public msgIncreasePositionMargin = + ExchangeModule.msgIncreasePositionMargin.bind(this); + public msgInstantSpotMarketLaunch = + ExchangeModule.msgInstantSpotMarketLaunch.bind(this); + public msgLiquidatePosition = + ExchangeModule.msgLiquidatePosition.bind(this); + public msgReclaimLockedFunds = + ExchangeModule.msgReclaimLockedFunds.bind(this); + public msgRewardsOptOut = ExchangeModule.msgRewardsOptOut.bind(this); + public msgSignData = ExchangeModule.msgSignData.bind(this); + public msgWithdraw = ExchangeModule.msgWithdraw.bind(this); + + // Governance message functions + public msgSubmitProposalExpiryFuturesMarketLaunch = + GovernanceModule.msgSubmitProposalExpiryFuturesMarketLaunch.bind(this); + public msgSubmitProposalSpotMarketLaunch = + GovernanceModule.msgSubmitProposalSpotMarketLaunch.bind(this); + public msgSubmitProposalPerpetualMarketLaunch = + GovernanceModule.msgSubmitProposalPerpetualMarketLaunch.bind(this); + public msgVote = GovernanceModule.msgVote.bind(this); + public msgSubmitTextProposal = + GovernanceModule.msgSubmitTextProposal.bind(this); + public msgSubmitProposalSpotMarketParamUpdate = + GovernanceModule.msgSubmitProposalSpotMarketParamUpdate.bind(this); + public msgSubmitGenericProposal = + GovernanceModule.msgSubmitGenericProposal.bind(this); + public msgGovDeposit = GovernanceModule.msgGovDeposit.bind(this); + + // IBC message functions + public msgIBCTransfer = IbcModule.msgIBCTransfer.bind(this); + + // Insurance Fund message functions + public msgCreateInsuranceFund = + InsuranceFundModule.msgCreateInsuranceFund.bind(this); + public msgRequestRedemption = + InsuranceFundModule.msgRequestRedemption.bind(this); + public msgUnderwrite = InsuranceFundModule.msgUnderwrite.bind(this); + + // Peggy message functions + public msgSendToEth = PeggyModule.msgSendToEth.bind(this); + + // Staking message functions + public msgBeginRedelegate = StakingModule.msgBeginRedelegate.bind(this); + public msgDelegate = StakingModule.msgDelegate.bind(this); + public msgUndelegate = StakingModule.msgUndelegate.bind(this); + public msgCreateValidator = StakingModule.msgCreateValidator.bind(this); + public msgEditValidator = StakingModule.msgEditValidator.bind(this); + public msgCancelUnbondingDelegation = + StakingModule.msgCancelUnbondingDelegation.bind(this); + + // Token Factory message functions + public msgBurn = TokenFactoryModule.msgBurn.bind(this); + public msgChangeAdmin = TokenFactoryModule.msgChangeAdmin.bind(this); + public msgCreateDenom = TokenFactoryModule.msgCreateDenom.bind(this); + public msgMint = TokenFactoryModule.msgMint.bind(this); + public msgSetDenomMetadata = + TokenFactoryModule.msgSetDenomMetadata.bind(this); + + // Wasm message functions + public msgStoreCode = WasmModule.msgStoreCode.bind(this); + public msgUpdateAdmin = WasmModule.msgUpdateAdmin.bind(this); + public msgExecuteContract = WasmModule.msgExecuteContract.bind(this); + public msgMigrateContract = WasmModule.msgMigrateContract.bind(this); + public msgInstantiateContract = + WasmModule.msgInstantiateContract.bind(this); + public msgExecuteContractCompat = + WasmModule.msgExecuteContractCompat.bind(this); + public msgPrivilegedExecuteContract = + WasmModule.msgPrivilegedExecuteContract.bind(this); +} diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/modules/insurance.ts b/packages/plugin-injective/injective-sdk-client-ts/src/modules/insurance.ts new file mode 100644 index 00000000000..c266fe16ba6 --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/modules/insurance.ts @@ -0,0 +1,197 @@ +import { InjectiveGrpcBase } from "../grpc/grpc-base"; +import { + MsgCreateInsuranceFund, + MsgRequestRedemption, + MsgUnderwrite, + TxResponse, +} from "@injectivelabs/sdk-ts"; +import { + MsgCreateInsuranceFundParams, + MsgRequestRedemptionParams, + MsgUnderwriteParams, + GetInsuranceFundParams, + GetEstimatedRedemptionsParams, + GetPendingRedemptionsParams, +} from "../types/insurance"; +import { + StandardResponse, + createSuccessResponse, + createErrorResponse, +} from "../types/index"; + +/** + * Fetches the insurance module parameters. + * + * @this InjectiveGrpcBase + * @returns {Promise} The standard response containing insurance module parameters or an error. + */ +export async function getInsuranceModuleParams( + this: InjectiveGrpcBase +): Promise { + try { + const result = await this.chainGrpcInsuranceFundApi.fetchModuleParams(); + + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getInsuranceModuleParamsError", err); + } +} + +/** + * Fetches a list of all insurance funds. + * + * @this InjectiveGrpcBase + * @returns {Promise} The standard response containing a list of insurance funds or an error. + */ +export async function getInsuranceFunds( + this: InjectiveGrpcBase +): Promise { + try { + const result = + await this.chainGrpcInsuranceFundApi.fetchInsuranceFunds(); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getInsuranceFundsError", err); + } +} + +/** + * Fetches details of a specific insurance fund by its market ID. + * + * @this InjectiveGrpcBase + * @param {InsuranceTypes.GetInsuranceFundParams} params - Parameters including the market ID. + * @returns {Promise} The standard response containing insurance fund details or an error. + */ +export async function getInsuranceFund( + this: InjectiveGrpcBase, + params: GetInsuranceFundParams +): Promise { + try { + const result = await this.chainGrpcInsuranceFundApi.fetchInsuranceFund( + params.marketId + ); + + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getInsuranceFundError", err); + } +} + +/** + * Fetches estimated redemptions based on provided parameters. + * + * @this InjectiveGrpcBase + * @param {InsuranceTypes.GetEstimatedRedemptionsParams} params - Parameters to filter estimated redemptions. + * @returns {Promise} The standard response containing estimated redemptions or an error. + */ +export async function getEstimatedRedemptions( + this: InjectiveGrpcBase, + params: GetEstimatedRedemptionsParams +): Promise { + try { + const result = + await this.chainGrpcInsuranceFundApi.fetchEstimatedRedemptions( + params + ); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getEstimatedRedemptionsError", err); + } +} + +/** + * Fetches pending redemptions based on provided parameters. + * + * @this InjectiveGrpcBase + * @param {InsuranceTypes.GetPendingRedemptionsParams} params - Parameters to filter pending redemptions. + * @returns {Promise} The standard response containing pending redemptions or an error. + */ +export async function getPendingRedemptions( + this: InjectiveGrpcBase, + params: GetPendingRedemptionsParams +): Promise { + try { + const result = + await this.chainGrpcInsuranceFundApi.fetchPendingRedemptions( + params + ); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getPendingRedemptionsError", err); + } +} + +/** + * Broadcasts a message to create a new insurance fund. + * + * @this InjectiveGrpcBase + * @param {InsuranceTypes.MsgCreateInsuranceFundParams} params - Parameters to create the insurance fund. + * @returns {Promise} The standard response containing the transaction result or an error. + */ +export async function msgCreateInsuranceFund( + this: InjectiveGrpcBase, + params: MsgCreateInsuranceFundParams +): Promise { + try { + const msg = MsgCreateInsuranceFund.fromJSON({ + ...params, + injectiveAddress: this.injAddress, + }); + const result: TxResponse = await this.msgBroadcaster.broadcast({ + msgs: msg, + }); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("msgCreateInsuranceFundError", err); + } +} + +/** + * Broadcasts a message to request a redemption from an insurance fund. + * + * @this InjectiveGrpcBase + * @param {InsuranceTypes.MsgRequestRedemptionParams} params - Parameters to request the redemption. + * @returns {Promise} The standard response containing the transaction result or an error. + */ +export async function msgRequestRedemption( + this: InjectiveGrpcBase, + params: MsgRequestRedemptionParams +): Promise { + try { + const msg = MsgRequestRedemption.fromJSON({ + ...params, + injectiveAddress: this.injAddress, + }); + const result: TxResponse = await this.msgBroadcaster.broadcast({ + msgs: msg, + }); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("msgRequestRedemptionError", err); + } +} + +/** + * Broadcasts a message to underwrite an insurance fund. + * + * @this InjectiveGrpcBase + * @param {InsuranceTypes.MsgUnderwriteParams} params - Parameters to underwrite the insurance fund. + * @returns {Promise} The standard response containing the transaction result or an error. + */ +export async function msgUnderwrite( + this: InjectiveGrpcBase, + params: MsgUnderwriteParams +): Promise { + try { + const msg = MsgUnderwrite.fromJSON({ + ...params, + injectiveAddress: this.injAddress, + }); + const result: TxResponse = await this.msgBroadcaster.broadcast({ + msgs: msg, + }); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("msgUnderwriteError", err); + } +} diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/modules/mint.ts b/packages/plugin-injective/injective-sdk-client-ts/src/modules/mint.ts new file mode 100644 index 00000000000..d4e381245a1 --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/modules/mint.ts @@ -0,0 +1,63 @@ +import { InjectiveGrpcBase } from "../grpc/grpc-base"; +import { + StandardResponse, + createSuccessResponse, + createErrorResponse, +} from "../types/index"; + +/** + * Fetches the parameters of the Mint module. + * + * @this InjectiveGrpcBase + * @returns {Promise} + * - On success: A standard response containing Mint module parameters. + * - On failure: A standard response containing an error message. + */ +export async function getMintModuleParams( + this: InjectiveGrpcBase +): Promise { + try { + const result = await this.chainGrpcMintApi.fetchModuleParams(); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getMintModuleParamsError", err); + } +} + +/** + * Retrieves the current inflation rate. + * + * @this InjectiveGrpcBase + * @returns {Promise} + * - On success: A standard response containing the current inflation rate. + * - On failure: A standard response containing an error message. + */ +export async function getInflation( + this: InjectiveGrpcBase +): Promise { + try { + const result = await this.chainGrpcMintApi.fetchInflation(); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getInflationError", err); + } +} + +/** + * Obtains the annual provisions. + * + * @this InjectiveGrpcBase + * @returns {Promise} + * - On success: A standard response containing the annual provisions. + * - On failure: A standard response containing an error message. + */ +export async function getAnnualProvisions( + this: InjectiveGrpcBase +): Promise { + try { + const result = await this.chainGrpcMintApi.fetchAnnualProvisions(); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getAnnualProvisionsError", err); + } +} diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/modules/mito.ts b/packages/plugin-injective/injective-sdk-client-ts/src/modules/mito.ts new file mode 100644 index 00000000000..7bad58676fa --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/modules/mito.ts @@ -0,0 +1,763 @@ +import { InjectiveGrpcBase } from "../grpc/grpc-base"; +import * as MitoTypes from "../types/mito"; +import { + StandardResponse, + createSuccessResponse, + createErrorResponse, +} from "../types/index"; +import { + MsgExecuteContractCompat, + MsgPrivilegedExecuteContract, + getDefaultSubaccountId, + ExecPrivilegedArgVaultSubscribe, + ExecPrivilegedArgVaultRedeem, + spotQuantityToChainQuantityToFixed, +} from "@injectivelabs/sdk-ts"; +/** + * Fetches the details of a specific vault. + * + * @this InjectiveGrpcBase + * @param {MitoTypes.GetVaultParams} params - Parameters including the vault identifier. + * @returns {Promise} + * - On success: A standard response containing vault details. + * - On failure: A standard response containing an error message. + */ +export async function getVault( + this: InjectiveGrpcBase, + params: MitoTypes.GetVaultParams +): Promise { + try { + const result = await this.indexerGrpcMitoApi.fetchVault(params); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getVaultError", err); + } +} + +/** + * Fetches a list of all vaults with optional filtering. + * + * @this InjectiveGrpcBase + * @param {MitoTypes.GetVaultsParams} [params={}] - Optional parameters to filter the list of vaults. + * @returns {Promise} + * - On success: A standard response containing a list of vaults. + * - On failure: A standard response containing an error message. + */ +export async function getVaults( + this: InjectiveGrpcBase, + params: MitoTypes.GetVaultsParams = {} +): Promise { + try { + const result = await this.indexerGrpcMitoApi.fetchVaults(params); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getVaultsError", err); + } +} + +/** + * Retrieves the price chart data for LP tokens. + * + * @this InjectiveGrpcBase + * @param {MitoTypes.GetLpTokenPriceChartParams} params - Parameters including the LP token identifier and chart options. + * @returns {Promise} + * - On success: A standard response containing LP token price chart data. + * - On failure: A standard response containing an error message. + */ +export async function getLpTokenPriceChart( + this: InjectiveGrpcBase, + params: MitoTypes.GetLpTokenPriceChartParams +): Promise { + try { + const result = + await this.indexerGrpcMitoApi.fetchLpTokenPriceChart(params); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getLpTokenPriceChartError", err); + } +} + +/** + * Retrieves the Total Value Locked (TVL) chart data. + * + * @this InjectiveGrpcBase + * @param {MitoTypes.GetTVLChartParams} params - Parameters including time range and other chart options. + * @returns {Promise} + * - On success: A standard response containing TVL chart data. + * - On failure: A standard response containing an error message. + */ +export async function getTVLChart( + this: InjectiveGrpcBase, + params: MitoTypes.GetTVLChartParams +): Promise { + try { + const result = + await this.indexerGrpcMitoApi.fetchTVLChartRequest(params); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getTVLChartError", err); + } +} + +/** + * Fetches vaults associated with a specific holder address. + * + * @this InjectiveGrpcBase + * @param {MitoTypes.GetVaultsByHolderAddressParams} params - Parameters including the holder's address. + * @returns {Promise} + * - On success: A standard response containing vaults linked to the holder. + * - On failure: A standard response containing an error message. + */ +export async function getVaultsByHolderAddress( + this: InjectiveGrpcBase, + params: MitoTypes.GetVaultsByHolderAddressParams +): Promise { + try { + const result = + await this.indexerGrpcMitoApi.fetchVaultsByHolderAddress(params); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getVaultsByHolderAddressError", err); + } +} + +/** + * Retrieves a list of LP token holders. + * + * @this InjectiveGrpcBase + * @param {MitoTypes.GetLPHoldersParams} params - Parameters to filter LP token holders. + * @returns {Promise} + * - On success: A standard response containing a list of LP token holders. + * - On failure: A standard response containing an error message. + */ +export async function getLPHolders( + this: InjectiveGrpcBase, + params: MitoTypes.GetLPHoldersParams +): Promise { + try { + const result = await this.indexerGrpcMitoApi.fetchLPHolders(params); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getLPHoldersError", err); + } +} + +/** + * Retrieves the portfolio details of a specific holder. + * + * @this InjectiveGrpcBase + * @param {MitoTypes.GetHolderPortfolioParams} params - Parameters including the holder's address. + * @returns {Promise} + * - On success: A standard response containing the holder's portfolio details. + * - On failure: A standard response containing an error message. + */ +export async function getHolderPortfolio( + this: InjectiveGrpcBase, + params: MitoTypes.GetHolderPortfolioParams +): Promise { + try { + const result = + await this.indexerGrpcMitoApi.fetchHolderPortfolio(params); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getHolderPortfolioError", err); + } +} + +/** + * Retrieves the leaderboard for a specific epoch. + * + * @this InjectiveGrpcBase + * @param {MitoTypes.GetLeaderboardParams} params - Parameters including the epoch identifier. + * @returns {Promise} + * - On success: A standard response containing leaderboard details for the epoch. + * - On failure: A standard response containing an error message. + */ +export async function getLeaderboard( + this: InjectiveGrpcBase, + params: MitoTypes.GetLeaderboardParams +): Promise { + try { + const result = await this.indexerGrpcMitoApi.fetchLeaderboard( + params.epochId + ); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getLeaderboardError", err); + } +} + +/** + * Fetches the transfer history based on provided parameters. + * + * @this InjectiveGrpcBase + * @param {MitoTypes.GetTransferHistoryParams} params - Parameters to filter transfer history. + * @returns {Promise} + * - On success: A standard response containing transfer history data. + * - On failure: A standard response containing an error message. + */ +export async function getTransferHistory( + this: InjectiveGrpcBase, + params: MitoTypes.GetTransferHistoryParams +): Promise { + try { + const result = + await this.indexerGrpcMitoApi.fetchTransferHistory(params); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getTransferHistoryError", err); + } +} + +/** + * Retrieves the epochs associated with leaderboards. + * + * @this InjectiveGrpcBase + * @param {MitoTypes.GetLeaderboardEpochsParams} [params={}] - Optional parameters to filter leaderboard epochs. + * @returns {Promise} + * - On success: A standard response containing leaderboard epochs. + * - On failure: A standard response containing an error message. + */ +export async function getLeaderboardEpochs( + this: InjectiveGrpcBase, + params: MitoTypes.GetLeaderboardEpochsParams = {} +): Promise { + try { + const result = + await this.indexerGrpcMitoApi.fetchLeaderboardEpochs(params); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getLeaderboardEpochsError", err); + } +} + +/** + * Retrieves information about staking pools. + * + * @this InjectiveGrpcBase + * @param {MitoTypes.GetStakingPoolsParams} params - Parameters to filter staking pools. + * @returns {Promise} + * - On success: A standard response containing staking pool details. + * - On failure: A standard response containing an error message. + */ +export async function getStakingPools( + this: InjectiveGrpcBase, + params: MitoTypes.GetStakingPoolsParams +): Promise { + try { + const result = await this.indexerGrpcMitoApi.fetchStakingPools(params); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getStakingPoolsError", err); + } +} + +/** + * Retrieves the staking history based on provided parameters. + * + * @this InjectiveGrpcBase + * @param {MitoTypes.GetStakingHistoryParams} [params={}] - Optional parameters to filter staking history. + * @returns {Promise} + * - On success: A standard response containing staking history data. + * - On failure: A standard response containing an error message. + */ +export async function getStakingHistory( + this: InjectiveGrpcBase, + params: MitoTypes.GetStakingHistoryParams = {} +): Promise { + try { + const result = + await this.indexerGrpcMitoApi.fetchStakingHistory(params); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getStakingHistoryError", err); + } +} + +/** + * Retrieves staking rewards for a specific account. + * + * @this InjectiveGrpcBase + * @param {MitoTypes.GetStakingRewardsByAccountParams} params - Parameters including the account identifier. + * @returns {Promise} + * - On success: A standard response containing staking rewards details. + * - On failure: A standard response containing an error message. + */ +export async function getStakingRewardsByAccount( + this: InjectiveGrpcBase, + params: MitoTypes.GetStakingRewardsByAccountParams +): Promise { + try { + const result = + await this.indexerGrpcMitoApi.fetchStakingRewardsByAccount(params); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getStakingRewardsByAccountError", err); + } +} + +/** + * Fetches a list of missions based on provided parameters. + * + * @this InjectiveGrpcBase + * @param {MitoTypes.GetMissionsParams} params - Parameters to filter missions. + * @returns {Promise} + * - On success: A standard response containing a list of missions. + * - On failure: A standard response containing an error message. + */ +export async function getMissions( + this: InjectiveGrpcBase, + params: MitoTypes.GetMissionsParams +): Promise { + try { + const result = await this.indexerGrpcMitoApi.fetchMissions(params); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getMissionsError", err); + } +} + +/** + * Retrieves the leaderboard for missions based on the user address. + * + * @this InjectiveGrpcBase + * @param {MitoTypes.GetMissionLeaderboardParams} [params={}] - Optional parameters including the user's address. + * @returns {Promise} + * - On success: A standard response containing the mission leaderboard. + * - On failure: A standard response containing an error message. + */ +export async function getMissionLeaderboard( + this: InjectiveGrpcBase, + params: MitoTypes.GetMissionLeaderboardParams = {} +): Promise { + try { + const result = await this.indexerGrpcMitoApi.fetchMissionLeaderboard( + params.userAddress + ); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getMissionLeaderboardError", err); + } +} + +/** + * Fetches details of a specific Initial DEX Offering (IDO). + * + * @this InjectiveGrpcBase + * @param {MitoTypes.GetIDOParams} params - Parameters including the IDO identifier. + * @returns {Promise} + * - On success: A standard response containing IDO details. + * - On failure: A standard response containing an error message. + */ +export async function getIDO( + this: InjectiveGrpcBase, + params: MitoTypes.GetIDOParams +): Promise { + try { + const result = await this.indexerGrpcMitoApi.fetchIDO(params); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getIDOError", err); + } +} + +/** + * Retrieves a list of all IDOs with optional filtering. + * + * @this InjectiveGrpcBase + * @param {MitoTypes.GetIDOsParams} [params={}] - Optional parameters to filter the list of IDOs. + * @returns {Promise} + * - On success: A standard response containing a list of IDOs. + * - On failure: A standard response containing an error message. + */ +export async function getIDOs( + this: InjectiveGrpcBase, + params: MitoTypes.GetIDOsParams = {} +): Promise { + try { + const result = await this.indexerGrpcMitoApi.fetchIDOs(params); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getIDOsError", err); + } +} + +/** + * Fetches subscribers for a specific IDO. + * + * @this InjectiveGrpcBase + * @param {MitoTypes.GetIDOSubscribersParams} params - Parameters including the IDO identifier. + * @returns {Promise} + * - On success: A standard response containing a list of subscribers. + * - On failure: A standard response containing an error message. + */ +export async function getIDOSubscribers( + this: InjectiveGrpcBase, + params: MitoTypes.GetIDOSubscribersParams +): Promise { + try { + const result = + await this.indexerGrpcMitoApi.fetchIDOSubscribers(params); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getIDOSubscribersError", err); + } +} + +/** + * Retrieves the subscription details for a specific IDO. + * + * @this InjectiveGrpcBase + * @param {MitoTypes.GetIDOSubscriptionParams} params - Parameters including the IDO identifier. + * @returns {Promise} + * - On success: A standard response containing subscription details. + * - On failure: A standard response containing an error message. + */ +export async function getIDOSubscription( + this: InjectiveGrpcBase, + params: MitoTypes.GetIDOSubscriptionParams +): Promise { + try { + const result = + await this.indexerGrpcMitoApi.fetchIDOSubscription(params); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getIDOSubscriptionError", err); + } +} + +/** + * Retrieves activities related to a specific IDO. + * + * @this InjectiveGrpcBase + * @param {MitoTypes.GetIDOActivitiesParams} [params={}] - Optional parameters to filter IDO activities. + * @returns {Promise} + * - On success: A standard response containing IDO activities. + * - On failure: A standard response containing an error message. + */ +export async function getIDOActivities( + this: InjectiveGrpcBase, + params: MitoTypes.GetIDOActivitiesParams = {} +): Promise { + try { + const result = await this.indexerGrpcMitoApi.fetchIDOActivities(params); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getIDOActivitiesError", err); + } +} + +/** + * Fetches the whitelist for a specific IDO. + * + * @this InjectiveGrpcBase + * @param {MitoTypes.GetIDOWhitelistParams} params - Parameters including the IDO identifier. + * @returns {Promise} + * - On success: A standard response containing the IDO whitelist. + * - On failure: A standard response containing an error message. + */ +export async function getIDOWhitelist( + this: InjectiveGrpcBase, + params: MitoTypes.GetIDOWhitelistParams +): Promise { + try { + const result = await this.indexerGrpcMitoApi.fetchIDOWhitelist(params); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getIDOWhitelistError", err); + } +} + +/** + * Retrieves claim references based on provided parameters. + * + * @this InjectiveGrpcBase + * @param {MitoTypes.GetClaimReferencesParams} params - Parameters to filter claim references. + * @returns {Promise} + * - On success: A standard response containing claim references. + * - On failure: A standard response containing an error message. + */ +export async function getClaimReferences( + this: InjectiveGrpcBase, + params: MitoTypes.GetClaimReferencesParams +): Promise { + try { + const result = + await this.indexerGrpcMitoApi.fetchClaimReferences(params); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getClaimReferencesError", err); + } +} +// All these fucntions from here on out broadcasts messages to the chain. +export async function subscribeLaunchpad( + this: InjectiveGrpcBase, + params: MitoTypes.GetLaunchpadSubscribeParams +): Promise { + try { + const { amount, quoteTokenDenom, quoteTokenDecimals, contractAddress } = + params; + + const msgs = MsgExecuteContractCompat.fromJSON({ + sender: this.injAddress, + funds: [ + { + denom: quoteTokenDenom, + amount: spotQuantityToChainQuantityToFixed({ + value: amount, + baseDecimals: quoteTokenDecimals, + }), + }, + ], + contractAddress, + exec: { + action: "Subscribe", + msg: {}, + }, + }); + + const response = this.msgBroadcaster.broadcast({ msgs }); + return createSuccessResponse(response); + } catch (err) { + return createErrorResponse("mito launchpad subscription error!", err); + } +} +export async function claimLaunchpad( + this: InjectiveGrpcBase, + params: MitoTypes.GetLaunchpadClaimParams +): Promise { + try { + const { contractAddress } = params; + + const msgs = MsgExecuteContractCompat.fromJSON({ + sender: this.injAddress, + contractAddress, + exec: { + action: "Claim", + msg: {}, + }, + }); + + const response = await this.msgBroadcaster.broadcast({ msgs }); + + return createSuccessResponse(response); + } catch (err) { + return createErrorResponse("claimLaunchpadSubscription!", err); + } +} +// TODO : Need safer params for the xyk CPMM +export async function instantiateCPMMVault( + this: InjectiveGrpcBase, + params: MitoTypes.GetInstantiateCPMMVaultParams +): Promise { + try { + const defaultAmmConfig = { + notional_value_cap: "100000000000000000000000", + pricing_strategy: { + SmoothingPricingWithRelativePriceRange: { + bid_range: "0.8", + ask_range: "0.8", + }, + }, + max_invariant_sensitivity_bps: "5", + max_price_sensitivity_bps: "5", + order_type: "Vanilla", + }; + + const msgs = MsgExecuteContractCompat.fromJSON({ + contractAddress: params.MITO_MASTER_CONTRACT_ADDRESS, + funds: params.funds, + exec: { + action: "register_vault", + msg: { + is_subscribing_with_funds: true, + registration_mode: { + permissionless: { + whitelisted_vault_code_id: + params.CPMM_CONTRACT_CODE, + }, + }, + instantiate_vault_msg: { + Amm: { + owner: this.injAddress, + master_address: params.MITO_MASTER_CONTRACT_ADDRESS, + market_id: params.marketId, + fee_bps: params.feeBps, + config_owner: this.injAddress, + base_decimals: params.baseDecimals, + quote_decimals: params.quoteDecimals, + ...defaultAmmConfig, + }, + }, + }, + }, + sender: this.injAddress, + }); + const result = await this.msgBroadcaster.broadcast({ msgs }); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("instantiateCPMMVaultError", err); + } +} + +export async function subscribeToVault( + this: InjectiveGrpcBase, + params: MitoTypes.GetVaultSubscribeParams +): Promise { + try { + const data = ExecPrivilegedArgVaultSubscribe.fromJSON({ + args: + params.vaultType === MitoTypes.VaultContractType.CPMM + ? { slippage: params.slippage } + : {}, + origin: this.injAddress, + vaultSubaccountId: params.vaultSubaccountId, + traderSubaccountId: getDefaultSubaccountId(this.injAddress), + }); + + const formattedBaseAmount = + params.subscriptionType !== MitoTypes.SpotRedemptionType.QuoteOnly + ? `${spotQuantityToChainQuantityToFixed({ + value: params.baseAmount, + baseDecimals: params.market.baseDecimals, + })} ${params.market.baseDenom}` + : ""; + + const formattedQuoteAmount = + params.subscriptionType !== MitoTypes.SpotRedemptionType.BaseOnly + ? `${spotQuantityToChainQuantityToFixed({ + value: params.quoteAmount, + baseDecimals: params.market.quoteDecimals, + })} ${params.market.quoteDenom}` + : ""; + + const funds = [formattedBaseAmount, formattedQuoteAmount] + .filter((amount) => amount) + .join(", "); + + const msgs = MsgPrivilegedExecuteContract.fromJSON({ + data, + sender: this.injAddress, + funds, + contractAddress: params.masterAddress, + }); + const result = await this.msgBroadcaster.broadcast({ msgs }); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("subscribeToVaultError", err); + } +} + +export async function redeemFromVault( + this: InjectiveGrpcBase, + params: MitoTypes.GetVaultRedeemParams +): Promise { + try { + const data = ExecPrivilegedArgVaultRedeem.fromJSON({ + origin: this.injAddress, + vaultSubaccountId: params.vaultSubaccountId, + traderSubaccountId: getDefaultSubaccountId(this.injAddress), + args: { + ...(params.marketType === MitoTypes.VaultMarketType.Derivative + ? { slippage: params.slippage } + : {}), + redemption_type: params.redemptionType, + }, + }); + + const amount = spotQuantityToChainQuantityToFixed({ + value: params.redeemAmount, + baseDecimals: params.vaultBaseDecimals, + }); + + const msgs = MsgPrivilegedExecuteContract.fromJSON({ + data, + sender: this.injAddress, + contractAddress: params.masterAddress, + funds: `${amount} ${params.vaultLpDenom}`, + }); + const result = await this.msgBroadcaster.broadcast({ msgs }); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("redeemFromVaultError", err); + } +} + +export async function stakeVaultLP( + this: InjectiveGrpcBase, + params: MitoTypes.GetStakeVaultLPParams +): Promise { + try { + const msgs = MsgExecuteContractCompat.fromJSON({ + sender: this.injAddress, + funds: [ + { + denom: params.vaultLpDenom, + amount: spotQuantityToChainQuantityToFixed({ + value: params.amount, + baseDecimals: params.vaultTokenDecimals, + }), + }, + ], + contractAddress: params.stakingContractAddress, + exec: { + action: "stake", + msg: {}, + }, + }); + const result = await this.msgBroadcaster.broadcast({ msgs }); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("stakeVaultLPError", err); + } +} + +export async function unstakeVaultLP( + this: InjectiveGrpcBase, + params: MitoTypes.GetUnstakeVaultLPParams +): Promise { + try { + const msgs = MsgExecuteContractCompat.fromJSON({ + sender: this.injAddress, + contractAddress: params.stakingContractAddress, + exec: { + action: "unstake", + msg: { + coin: { + denom: params.vaultLpDenom, + amount: spotQuantityToChainQuantityToFixed({ + value: params.amount, + baseDecimals: params.vaultTokenDecimals, + }), + }, + }, + }, + }); + const result = await this.msgBroadcaster.broadcast({ msgs }); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("unstakeVaultLPError", err); + } +} + +export async function claimVaultRewards( + this: InjectiveGrpcBase, + params: MitoTypes.GetClaimVaultRewardsParams +): Promise { + try { + const msgs = MsgExecuteContractCompat.fromJSON({ + sender: this.injAddress, + contractAddress: params.stakingContractAddress, + exec: { + action: "claim_rewards", + msg: { + lp_token: params.vaultLpDenom, + }, + }, + }); + const result = await this.msgBroadcaster.broadcast({ msgs }); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("claimVaultRewardsError", err); + } +} diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/modules/oracle.ts b/packages/plugin-injective/injective-sdk-client-ts/src/modules/oracle.ts new file mode 100644 index 00000000000..168877c28c3 --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/modules/oracle.ts @@ -0,0 +1,25 @@ +import { InjectiveGrpcBase } from "../grpc/grpc-base"; +import { + StandardResponse, + createSuccessResponse, + createErrorResponse, +} from "../types/index"; + +/** + * Fetches the parameters of the Oracle module. + * + * @this InjectiveGrpcBase + * @returns {Promise} + * - On success: A standard response containing Oracle module parameters. + * - On failure: A standard response containing an error message. + */ +export async function getOracleModuleParams( + this: InjectiveGrpcBase +): Promise { + try { + const result = await this.chainGrpcOracleApi.fetchModuleParams(); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getOracleModuleParamsError", err); + } +} diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/modules/peggy.ts b/packages/plugin-injective/injective-sdk-client-ts/src/modules/peggy.ts new file mode 100644 index 00000000000..a1d1164f66c --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/modules/peggy.ts @@ -0,0 +1,59 @@ +import { InjectiveGrpcBase } from "../grpc/grpc-base"; +import { + PeggyModuleParams, + MsgSendToEth, + TxResponse, +} from "@injectivelabs/sdk-ts"; +import { MsgSendToEthParams } from "../types/peggy"; +import { + StandardResponse, + createSuccessResponse, + createErrorResponse, +} from "../types/index"; + +/** + * Fetches the parameters of the Peggy module. + * + * @this InjectiveGrpcBase + * @returns {Promise} + * - On success: A standard response containing Peggy module parameters. + * - On failure: A standard response containing an error message. + */ +export async function getPeggyModuleParams( + this: InjectiveGrpcBase +): Promise { + try { + const result = await this.chainGrpcPeggyApi.fetchModuleParams(); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getPeggyModuleParamsError", err); + } +} + +/** + * Broadcasts a message to send tokens to an Ethereum address via IBC transfer. + * + * @this InjectiveGrpcBase + * @param {MsgSendToEthParams} params - Parameters including the recipient address and transfer details. + * @returns {Promise} + * - On success: A standard response containing the transaction result. + * - On failure: A standard response containing an error message. + */ +export async function msgSendToEth( + this: InjectiveGrpcBase, + params: MsgSendToEthParams +): Promise { + try { + const msg = MsgSendToEth.fromJSON({ + ...params, + injectiveAddress: this.injAddress, + address: this.ethAddress, + }); + const result: TxResponse = await this.msgBroadcaster.broadcast({ + msgs: msg, + }); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("msgSendToEthError", err); + } +} diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/modules/permissions.ts b/packages/plugin-injective/injective-sdk-client-ts/src/modules/permissions.ts new file mode 100644 index 00000000000..d805b73f135 --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/modules/permissions.ts @@ -0,0 +1,133 @@ +import { InjectiveGrpcBase } from "../grpc/grpc-base"; +import * as PermissionsType from "../types/permissions"; +import { + StandardResponse, + createSuccessResponse, + createErrorResponse, +} from "../types/index"; + +/** + * Fetches addresses associated with a specific role. + * + * @this InjectiveGrpcBase + * @param {GetAddressesByRoleParams} params - Parameters including the role identifier. + * @returns {Promise} + * - On success: A standard response containing a list of addresses. + * - On failure: A standard response containing an error message. + */ +export async function getAddressesByRole( + this: InjectiveGrpcBase, + params: PermissionsType.GetAddressesByRoleParams +): Promise { + try { + const result = + await this.chainGrpcPermissionsApi.fetchAddressesByRole(params); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getAddressesByRoleError", err); + } +} + +/** + * Retrieves roles associated with a specific address. + * + * @this InjectiveGrpcBase + * @param {GetAddressRolesParams} params - Parameters including the address identifier. + * @returns {Promise} + * - On success: A standard response containing a list of roles. + * - On failure: A standard response containing an error message. + */ +export async function getAddressRoles( + this: InjectiveGrpcBase, + params: PermissionsType.GetAddressRolesParams +): Promise { + try { + const result = + await this.chainGrpcPermissionsApi.fetchAddressRoles(params); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getAddressRolesError", err); + } +} + +/** + * Retrieves all namespaces within the permissions module. + * + * @this InjectiveGrpcBase + * @returns {Promise} + * - On success: A standard response containing a list of namespaces. + * - On failure: A standard response containing an error message. + */ +export async function getAllNamespaces( + this: InjectiveGrpcBase +): Promise { + try { + const result = await this.chainGrpcPermissionsApi.fetchAllNamespaces(); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getAllNamespacesError", err); + } +} + +/** + * Fetches the parameters of the Permissions module. + * + * @this InjectiveGrpcBase + * @returns {Promise} + * - On success: A standard response containing Permissions module parameters. + * - On failure: A standard response containing an error message. + */ +export async function getPermissionsModuleParams( + this: InjectiveGrpcBase +): Promise { + try { + const result = await this.chainGrpcPermissionsApi.fetchModuleParams(); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getPermissionsModuleParamsError", err); + } +} + +/** + * Retrieves the namespace associated with a specific denomination. + * + * @this InjectiveGrpcBase + * @param {GetNamespaceByDenomParams} params - Parameters including the denomination identifier. + * @returns {Promise} + * - On success: A standard response containing the namespace. + * - On failure: A standard response containing an error message. + */ +export async function getNamespaceByDenom( + this: InjectiveGrpcBase, + params: PermissionsType.GetNamespaceByDenomParams +): Promise { + try { + const result = + await this.chainGrpcPermissionsApi.fetchNamespaceByDenom(params); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getNamespaceByDenomError", err); + } +} + +/** + * Retrieves vouchers associated with a specific address. + * + * @this InjectiveGrpcBase + * @param {GetVouchersForAddressParams} params - Parameters including the address identifier. + * @returns {Promise} + * - On success: A standard response containing a list of vouchers. + * - On failure: A standard response containing an error message. + */ +export async function getVouchersForAddress( + this: InjectiveGrpcBase, + params: PermissionsType.GetVouchersForAddressParams +): Promise { + try { + const result = + await this.chainGrpcPermissionsApi.fetchVouchersForAddress(params); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getVouchersForAddressError", err); + } +} diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/modules/staking.ts b/packages/plugin-injective/injective-sdk-client-ts/src/modules/staking.ts new file mode 100644 index 00000000000..2688dbf851b --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/modules/staking.ts @@ -0,0 +1,500 @@ +import { InjectiveGrpcBase } from "../grpc/grpc-base"; +import { + MsgBeginRedelegate, + MsgDelegate, + MsgUndelegate, + MsgCreateValidator, + MsgEditValidator, + MsgCancelUnbondingDelegation, +} from "@injectivelabs/sdk-ts"; +import * as StakingTypes from "../types/staking"; +import { + StandardResponse, + createSuccessResponse, + createErrorResponse, +} from "../types/index"; + +// Staking Module Async Functions with Error Handling + +/** + * Fetches the staking module parameters. + * + * @this InjectiveGrpcBase + * @returns {Promise} The standard response containing module parameters or an error. + */ +export async function getStakingModuleParams( + this: InjectiveGrpcBase +): Promise { + try { + const result = await this.chainGrpcStakingApi.fetchModuleParams(); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getStakingModuleParamsError", err); + } +} + +/** + * Fetches the staking pool information. + * + * @this InjectiveGrpcBase + * @returns {Promise} The standard response containing pool information or an error. + */ +export async function getPool( + this: InjectiveGrpcBase +): Promise { + try { + const result = await this.chainGrpcStakingApi.fetchPool(); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getPoolError", err); + } +} + +/** + * Fetches a list of validators with optional pagination. + * + * @this InjectiveGrpcBase + * @param {StakingTypes.GetValidatorsParams} params - Parameters including pagination options. + * @returns {Promise} The standard response containing validators or an error. + */ +export async function getValidators( + this: InjectiveGrpcBase, + params: StakingTypes.GetValidatorsParams = {} +): Promise { + try { + const result = await this.chainGrpcStakingApi.fetchValidators( + params.pagination + ); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getValidatorsError", err); + } +} + +/** + * Fetches a specific validator by address. + * + * @this InjectiveGrpcBase + * @param {StakingTypes.GetValidatorParams} params - Parameters including the validator's address. + * @returns {Promise} The standard response containing the validator or an error. + */ +export async function getValidator( + this: InjectiveGrpcBase, + params: StakingTypes.GetValidatorParams +): Promise { + try { + const result = await this.chainGrpcStakingApi.fetchValidator( + params.address + ); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getValidatorError", err); + } +} + +/** + * Fetches delegations for a specific validator. + * + * @this InjectiveGrpcBase + * @param {StakingTypes.GetValidatorDelegationsParams} params - Parameters including the validator's address and pagination options. + * @returns {Promise} The standard response containing delegations or an error. + */ +export async function getValidatorDelegations( + this: InjectiveGrpcBase, + params: StakingTypes.GetValidatorDelegationsParams +): Promise { + try { + const result = + await this.chainGrpcStakingApi.fetchValidatorDelegations(params); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getValidatorDelegationsError", err); + } +} + +/** + * Fetches delegations for a specific validator without throwing an error. + * + * @this InjectiveGrpcBase + * @param {StakingTypes.GetValidatorDelegationsParams} params - Parameters including the validator's address and pagination options. + * @returns {Promise} The standard response containing delegations or an error. + */ +export async function getValidatorDelegationsNoThrow( + this: InjectiveGrpcBase, + params: StakingTypes.GetValidatorDelegationsParams +): Promise { + try { + const result = + await this.chainGrpcStakingApi.fetchValidatorDelegationsNoThrow( + params + ); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getValidatorDelegationsNoThrowError", err); + } +} + +/** + * Fetches unbonding delegations for a specific validator. + * + * @this InjectiveGrpcBase + * @param {StakingTypes.GetValidatorDelegationsParams} params - Parameters including the validator's address and pagination options. + * @returns {Promise} The standard response containing unbonding delegations or an error. + */ +export async function getValidatorUnbondingDelegations( + this: InjectiveGrpcBase, + params: StakingTypes.GetValidatorDelegationsParams +): Promise { + try { + const result = + await this.chainGrpcStakingApi.fetchValidatorUnbondingDelegations( + params + ); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse( + "getValidatorUnbondingDelegationsError", + err + ); + } +} + +/** + * Fetches unbonding delegations for a specific validator without throwing an error. + * + * @this InjectiveGrpcBase + * @param {StakingTypes.GetValidatorDelegationsParams} params - Parameters including the validator's address and pagination options. + * @returns {Promise} The standard response containing unbonding delegations or an error. + */ +export async function getValidatorUnbondingDelegationsNoThrow( + this: InjectiveGrpcBase, + params: StakingTypes.GetValidatorDelegationsParams +): Promise { + try { + const result = + await this.chainGrpcStakingApi.fetchValidatorUnbondingDelegationsNoThrow( + params + ); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse( + "getValidatorUnbondingDelegationsNoThrowError", + err + ); + } +} + +/** + * Fetches a specific delegation. + * + * @this InjectiveGrpcBase + * @param {StakingTypes.GetDelegationParams} params - Parameters including delegator and validator addresses. + * @returns {Promise} The standard response containing the delegation or an error. + */ +export async function getDelegation( + this: InjectiveGrpcBase, + params: StakingTypes.GetDelegationParams +): Promise { + try { + const result = await this.chainGrpcStakingApi.fetchDelegation(params); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getDelegationError", err); + } +} + +/** + * Fetches all delegations for a delegator. + * + * @this InjectiveGrpcBase + * @param {StakingTypes.GetDelegationsParams} params - Parameters including the delegator's address and pagination options. + * @returns {Promise} The standard response containing delegations or an error. + */ +export async function getDelegations( + this: InjectiveGrpcBase, + params: StakingTypes.GetDelegationsParams +): Promise { + try { + const result = await this.chainGrpcStakingApi.fetchDelegations(params); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getDelegationsError", err); + } +} + +/** + * Fetches all delegations for a delegator without throwing an error. + * + * @this InjectiveGrpcBase + * @param {StakingTypes.GetDelegationsParams} params - Parameters including the delegator's address and pagination options. + * @returns {Promise} The standard response containing delegations or an error. + */ +export async function getDelegationsNoThrow( + this: InjectiveGrpcBase, + params: StakingTypes.GetDelegationsParams +): Promise { + try { + const result = + await this.chainGrpcStakingApi.fetchDelegationsNoThrow(params); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getDelegationsNoThrowError", err); + } +} + +/** + * Fetches all delegators for a validator. + * + * @this InjectiveGrpcBase + * @param {StakingTypes.GetDelegatorsParams} params - Parameters including the validator's address and pagination options. + * @returns {Promise} The standard response containing delegators or an error. + */ +export async function getDelegators( + this: InjectiveGrpcBase, + params: StakingTypes.GetDelegatorsParams +): Promise { + try { + const result = await this.chainGrpcStakingApi.fetchDelegators(params); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getDelegatorsError", err); + } +} + +/** + * Fetches all delegators for a validator without throwing an error. + * + * @this InjectiveGrpcBase + * @param {StakingTypes.GetDelegatorsParams} params - Parameters including the validator's address and pagination options. + * @returns {Promise} The standard response containing delegators or an error. + */ +export async function getDelegatorsNoThrow( + this: InjectiveGrpcBase, + params: StakingTypes.GetDelegatorsParams +): Promise { + try { + const result = + await this.chainGrpcStakingApi.fetchDelegatorsNoThrow(params); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getDelegatorsNoThrowError", err); + } +} + +/** + * Fetches all unbonding delegations for a delegator. + * + * @this InjectiveGrpcBase + * @param {StakingTypes.GetUnbondingDelegationsParams} params - Parameters including the delegator's address and pagination options. + * @returns {Promise} The standard response containing unbonding delegations or an error. + */ +export async function getUnbondingDelegations( + this: InjectiveGrpcBase, + params: StakingTypes.GetUnbondingDelegationsParams +): Promise { + try { + const result = + await this.chainGrpcStakingApi.fetchUnbondingDelegations(params); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getUnbondingDelegationsError", err); + } +} + +/** + * Fetches all unbonding delegations for a delegator without throwing an error. + * + * @this InjectiveGrpcBase + * @param {StakingTypes.GetUnbondingDelegationsParams} params - Parameters including the delegator's address and pagination options. + * @returns {Promise} The standard response containing unbonding delegations or an error. + */ +export async function getUnbondingDelegationsNoThrow( + this: InjectiveGrpcBase, + params: StakingTypes.GetUnbondingDelegationsParams +): Promise { + try { + const result = + await this.chainGrpcStakingApi.fetchUnbondingDelegationsNoThrow( + params + ); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getUnbondingDelegationsNoThrowError", err); + } +} + +/** + * Fetches all redelegations for a delegator. + * + * @this InjectiveGrpcBase + * @param {StakingTypes.GetReDelegationsParams} params - Parameters including the delegator's address and pagination options. + * @returns {Promise} The standard response containing redelegations or an error. + */ +export async function getReDelegations( + this: InjectiveGrpcBase, + params: StakingTypes.GetReDelegationsParams +): Promise { + try { + const result = + await this.chainGrpcStakingApi.fetchReDelegations(params); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getReDelegationsError", err); + } +} + +/** + * Fetches all redelegations for a delegator without throwing an error. + * + * @this InjectiveGrpcBase + * @param {StakingTypes.GetReDelegationsParams} params - Parameters including the delegator's address and pagination options. + * @returns {Promise} The standard response containing redelegations or an error. + */ +export async function getReDelegationsNoThrow( + this: InjectiveGrpcBase, + params: StakingTypes.GetReDelegationsParams +): Promise { + try { + const result = + await this.chainGrpcStakingApi.fetchReDelegationsNoThrow(params); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getReDelegationsNoThrowError", err); + } +} + +/** + * Broadcasts a message to begin redelegating tokens. + * + * @this InjectiveGrpcBase + * @param {StakingTypes.MsgBeginRedelegateParams} params - Parameters including delegator address, source validator address, destination validator address, and amount. + * @returns {Promise} The standard response containing the broadcast result or an error. + */ +export async function msgBeginRedelegate( + this: InjectiveGrpcBase, + params: StakingTypes.MsgBeginRedelegateParams +): Promise { + try { + const msg = MsgBeginRedelegate.fromJSON({ + ...params, + injectiveAddress: this.injAddress, + }); + const result = await this.msgBroadcaster.broadcast({ msgs: msg }); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("msgBeginRedelegateError", err); + } +} + +/** + * Broadcasts a message to delegate tokens to a validator. + * + * @this InjectiveGrpcBase + * @param {StakingTypes.MsgDelegateParams} params - Parameters including delegator address, validator address, and amount. + * @returns {Promise} The standard response containing the broadcast result or an error. + */ +export async function msgDelegate( + this: InjectiveGrpcBase, + params: StakingTypes.MsgDelegateParams +): Promise { + try { + const msg = MsgDelegate.fromJSON({ + ...params, + injectiveAddress: this.injAddress, + }); + const result = await this.msgBroadcaster.broadcast({ msgs: msg }); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("msgDelegateError", err); + } +} + +/** + * Broadcasts a message to undelegate tokens from a validator. + * + * @this InjectiveGrpcBase + * @param {StakingTypes.MsgUndelegateParams} params - Parameters including delegator address, validator address, and amount. + * @returns {Promise} The standard response containing the broadcast result or an error. + */ +export async function msgUndelegate( + this: InjectiveGrpcBase, + params: StakingTypes.MsgUndelegateParams +): Promise { + try { + const msg = MsgUndelegate.fromJSON({ + ...params, + injectiveAddress: this.injAddress, + }); + const result = await this.msgBroadcaster.broadcast({ msgs: msg }); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("msgUndelegateError", err); + } +} + +/** + * Broadcasts a message to create a new validator. + * + * @this InjectiveGrpcBase + * @param {StakingTypes.MsgCreateValidatorParams} params - Parameters including delegator address, validator details, and commission rates. + * @returns {Promise} The standard response containing the broadcast result or an error. + */ +export async function msgCreateValidator( + this: InjectiveGrpcBase, + params: StakingTypes.MsgCreateValidatorParams +): Promise { + try { + const msg = MsgCreateValidator.fromJSON({ + ...params, + delegatorAddress: this.injAddress, + }); + const result = await this.msgBroadcaster.broadcast({ msgs: msg }); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("msgCreateValidatorError", err); + } +} + +/** + * Broadcasts a message to edit an existing validator. + * + * @this InjectiveGrpcBase + * @param {StakingTypes.MsgEditValidatorParams} params - Parameters including validator address and updated details. + * @returns {Promise} The standard response containing the broadcast result or an error. + */ +export async function msgEditValidator( + this: InjectiveGrpcBase, + params: StakingTypes.MsgEditValidatorParams +): Promise { + try { + const msg = MsgEditValidator.fromJSON({ + ...params, + }); + const result = await this.msgBroadcaster.broadcast({ msgs: msg }); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("msgEditValidatorError", err); + } +} + +/** + * Broadcasts a message to cancel an unbonding delegation. + * + * @this InjectiveGrpcBase + * @param {StakingTypes.MsgCancelUnbondingDelegationParams} params - Parameters including delegator address, validator address, and completion time. + * @returns {Promise} The standard response containing the broadcast result or an error. + */ +export async function msgCancelUnbondingDelegation( + this: InjectiveGrpcBase, + params: StakingTypes.MsgCancelUnbondingDelegationParams +): Promise { + try { + const msg = MsgCancelUnbondingDelegation.fromJSON({ + ...params, + }); + const result = await this.msgBroadcaster.broadcast({ msgs: msg }); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("msgCancelUnbondingDelegationError", err); + } +} diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/modules/token-factory.ts b/packages/plugin-injective/injective-sdk-client-ts/src/modules/token-factory.ts new file mode 100644 index 00000000000..7f74b048b3c --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/modules/token-factory.ts @@ -0,0 +1,210 @@ +import { InjectiveGrpcBase } from "../grpc/grpc-base"; +import { + MsgBurn, + MsgChangeAdmin, + MsgCreateDenom, + MsgMint, + MsgSetDenomMetadata, +} from "@injectivelabs/sdk-ts"; +import * as TokenFactoryTypes from "../types/token-factory"; +import { + StandardResponse, + createSuccessResponse, + createErrorResponse, +} from "../types/index"; + +// Token Factory Module Async Functions with Error Handling + +/** + * Fetches all denominations created by a specific creator. + * + * @this InjectiveGrpcBase + * @param {TokenFactoryTypes.GetDenomsFromCreatorParams} params - Parameters including the creator's address. + * @returns {Promise} The standard response containing denominations or an error. + */ +export async function getDenomsFromCreator( + this: InjectiveGrpcBase, + params: TokenFactoryTypes.GetDenomsFromCreatorParams +): Promise { + try { + const result = + await this.chainGrpcTokenFactoryApi.fetchDenomsFromCreator( + params.creator + ); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getDenomsFromCreatorError", err); + } +} + +/** + * Fetches the authority metadata for a specific denomination. + * + * @this InjectiveGrpcBase + * @param {TokenFactoryTypes.GetDenomAuthorityMetadataParams} params - Parameters including creator and sub-denomination. + * @returns {Promise} The standard response containing authority metadata or an error. + */ +export async function getDenomAuthorityMetadata( + this: InjectiveGrpcBase, + params: TokenFactoryTypes.GetDenomAuthorityMetadataParams +): Promise { + try { + const result = + await this.chainGrpcTokenFactoryApi.fetchDenomAuthorityMetadata( + params.creator, + params.subDenom + ); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getDenomAuthorityMetadataError", err); + } +} + +/** + * Fetches the parameters of the Token Factory module. + * + * @this InjectiveGrpcBase + * @returns {Promise} The standard response containing module parameters or an error. + */ +export async function getTokenFactoryModuleParams( + this: InjectiveGrpcBase +): Promise { + try { + const result = await this.chainGrpcTokenFactoryApi.fetchModuleParams(); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getTokenFactoryModuleParamsError", err); + } +} + +/** + * Fetches the current state of the Token Factory module. + * + * @this InjectiveGrpcBase + * @returns {Promise} The standard response containing module state or an error. + */ +export async function getTokenFactoryModuleState( + this: InjectiveGrpcBase +): Promise { + try { + const result = await this.chainGrpcTokenFactoryApi.fetchModuleState(); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getTokenFactoryModuleStateError", err); + } +} + +/** + * Broadcasts a message to burn tokens. + * + * @this InjectiveGrpcBase + * @param {TokenFactoryTypes.MsgBurnParams} params - Parameters including sender and amount. + * @returns {Promise} The standard response containing the broadcast result or an error. + */ +export async function msgBurn( + this: InjectiveGrpcBase, + params: TokenFactoryTypes.MsgBurnParams +): Promise { + try { + const msg = MsgBurn.fromJSON({ + ...params, + sender: this.injAddress, + }); + const result = await this.msgBroadcaster.broadcast({ msgs: msg }); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("msgBurnError", err); + } +} + +/** + * Broadcasts a message to change the admin of a denomination. + * + * @this InjectiveGrpcBase + * @param {TokenFactoryTypes.MsgChangeAdminParams} params - Parameters including sender, denom, and new admin address. + * @returns {Promise} The standard response containing the broadcast result or an error. + */ +export async function msgChangeAdmin( + this: InjectiveGrpcBase, + params: TokenFactoryTypes.MsgChangeAdminParams +): Promise { + try { + const msg = MsgChangeAdmin.fromJSON({ + ...params, + sender: this.injAddress, + }); + const result = await this.msgBroadcaster.broadcast({ msgs: msg }); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("msgChangeAdminError", err); + } +} + +/** + * Broadcasts a message to create a new denomination. + * + * @this InjectiveGrpcBase + * @param {TokenFactoryTypes.MsgCreateDenomParams} params - Parameters including sender and sub-denomination. + * @returns {Promise} The standard response containing the broadcast result or an error. + */ +export async function msgCreateDenom( + this: InjectiveGrpcBase, + params: TokenFactoryTypes.MsgCreateDenomParams +): Promise { + try { + const msg = MsgCreateDenom.fromJSON({ + ...params, + sender: this.injAddress, + }); + const result = await this.msgBroadcaster.broadcast({ msgs: msg }); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("msgCreateDenomError", err); + } +} + +/** + * Broadcasts a message to mint new tokens. + * + * @this InjectiveGrpcBase + * @param {TokenFactoryTypes.MsgMintParams} params - Parameters including sender and total amount to mint. + * @returns {Promise} The standard response containing the broadcast result or an error. + */ +export async function msgMint( + this: InjectiveGrpcBase, + params: TokenFactoryTypes.MsgMintParams +): Promise { + try { + const msg = MsgMint.fromJSON({ + amount: params.totalAmount, + sender: this.injAddress, + }); + const result = await this.msgBroadcaster.broadcast({ msgs: msg }); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("msgMintError", err); + } +} + +/** + * Broadcasts a message to set metadata for a denomination. + * + * @this InjectiveGrpcBase + * @param {TokenFactoryTypes.MsgSetDenomMetadataParams} params - Parameters including sender and metadata details. + * @returns {Promise} The standard response containing the broadcast result or an error. + */ +export async function msgSetDenomMetadata( + this: InjectiveGrpcBase, + params: TokenFactoryTypes.MsgSetDenomMetadataParams +): Promise { + try { + const msg = MsgSetDenomMetadata.fromJSON({ + ...params, + sender: this.injAddress, + }); + const result = await this.msgBroadcaster.broadcast({ msgs: msg }); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("msgSetDenomMetadataError", err); + } +} diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/modules/wasm.ts b/packages/plugin-injective/injective-sdk-client-ts/src/modules/wasm.ts new file mode 100644 index 00000000000..5fedbd40f1a --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/modules/wasm.ts @@ -0,0 +1,369 @@ +import { InjectiveGrpcBase } from "../grpc/grpc-base"; +import { + MsgStoreCode, + MsgUpdateAdmin, + MsgExecuteContract, + MsgMigrateContract, + MsgInstantiateContract, + MsgExecuteContractCompat, + MsgPrivilegedExecuteContract, +} from "@injectivelabs/sdk-ts"; +import * as WasmTypes from "../types/wasm"; +import { + StandardResponse, + createSuccessResponse, + createErrorResponse, +} from "../types/index"; + +// Wasm Module Async Functions with Error Handling + +/** + * Fetches the balance of contract accounts. + * + * @this InjectiveGrpcBase + * @param {WasmTypes.GetContractAccountsBalanceParams} params - Parameters including contract addresses and pagination options. + * @returns {Promise} The standard response containing contract accounts balance or an error. + */ +export async function getContractAccountsBalance( + this: InjectiveGrpcBase, + params: WasmTypes.GetContractAccountsBalanceParams +): Promise { + try { + const result = + await this.chainGrpcWasmApi.fetchContractAccountsBalance(params); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getContractAccountsBalanceError", err); + } +} + +/** + * Fetches the state of a specific contract. + * + * @this InjectiveGrpcBase + * @param {WasmTypes.GetContractStateParams} params - Parameters including the contract address. + * @returns {Promise} The standard response containing contract state or an error. + */ +export async function getContractState( + this: InjectiveGrpcBase, + params: WasmTypes.GetContractStateParams +): Promise { + try { + const result = await this.chainGrpcWasmApi.fetchContractState(params); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getContractStateError", err); + } +} + +/** + * Fetches information about a specific contract. + * + * @this InjectiveGrpcBase + * @param {WasmTypes.GetContractInfoParams} params - Parameters including the contract address. + * @returns {Promise} The standard response containing contract info or an error. + */ +export async function getContractInfo( + this: InjectiveGrpcBase, + params: WasmTypes.GetContractInfoParams +): Promise { + try { + const result = await this.chainGrpcWasmApi.fetchContractInfo( + params.contractAddress + ); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getContractInfoError", err); + } +} + +/** + * Fetches the history of a specific contract. + * + * @this InjectiveGrpcBase + * @param {WasmTypes.GetContractHistoryParams} params - Parameters including the contract address. + * @returns {Promise} The standard response containing contract history or an error. + */ +export async function getContractHistory( + this: InjectiveGrpcBase, + params: WasmTypes.GetContractHistoryParams +): Promise { + try { + const result = await this.chainGrpcWasmApi.fetchContractHistory( + params.contractAddress + ); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getContractHistoryError", err); + } +} + +/** + * Fetches the smart contract state based on a query. + * + * @this InjectiveGrpcBase + * @param {WasmTypes.GetSmartContractStateParams} params - Parameters including contract address and query. + * @returns {Promise} The standard response containing smart contract state or an error. + */ +export async function getSmartContractState( + this: InjectiveGrpcBase, + params: WasmTypes.GetSmartContractStateParams +): Promise { + try { + const result = await this.chainGrpcWasmApi.fetchSmartContractState( + params.contractAddress, + params.query + ); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getSmartContractStateError", err); + } +} + +/** + * Fetches the raw state of a specific contract based on a query. + * + * @this InjectiveGrpcBase + * @param {WasmTypes.GetRawContractStateParams} params - Parameters including contract address and query. + * @returns {Promise} The standard response containing raw contract state or an error. + */ +export async function getRawContractState( + this: InjectiveGrpcBase, + params: WasmTypes.GetRawContractStateParams +): Promise { + try { + const result = await this.chainGrpcWasmApi.fetchRawContractState( + params.contractAddress, + params.query + ); + + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getRawContractStateError", err); + } +} + +/** + * Fetches all contract codes with optional pagination. + * + * @this InjectiveGrpcBase + * @param {WasmTypes.GetContractCodesParams} params - Parameters including pagination options. + * @returns {Promise} The standard response containing contract codes or an error. + */ +export async function getContractCodes( + this: InjectiveGrpcBase, + params: WasmTypes.GetContractCodesParams = {} +): Promise { + try { + const result = await this.chainGrpcWasmApi.fetchContractCodes( + params.pagination + ); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getContractCodesError", err); + } +} + +/** + * Fetches a specific contract code by its ID. + * + * @this InjectiveGrpcBase + * @param {WasmTypes.GetContractCodeParams} params - Parameters including the code ID. + * @returns {Promise} The standard response containing contract code or an error. + */ +export async function getContractCode( + this: InjectiveGrpcBase, + params: WasmTypes.GetContractCodeParams +): Promise { + try { + const result = await this.chainGrpcWasmApi.fetchContractCode( + params.codeId + ); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getContractCodeError", err); + } +} + +/** + * Fetches contracts associated with a specific contract code with optional pagination. + * + * @this InjectiveGrpcBase + * @param {WasmTypes.GetContractCodeContractsParams} params - Parameters including code ID and pagination options. + * @returns {Promise} The standard response containing contracts or an error. + */ +export async function getContractCodeContracts( + this: InjectiveGrpcBase, + params: WasmTypes.GetContractCodeContractsParams +): Promise { + try { + const result = await this.chainGrpcWasmApi.fetchContractCodeContracts( + params.codeId, + params.pagination + ); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getContractCodeContractsError", err); + } +} + +/** + * Broadcasts a message to store new contract code. + * + * @this InjectiveGrpcBase + * @param {WasmTypes.MsgStoreCodeParams} params - Parameters including sender and wasm bytecode. + * @returns {Promise} The standard response containing the broadcast result or an error. + */ +export async function msgStoreCode( + this: InjectiveGrpcBase, + params: WasmTypes.MsgStoreCodeParams +): Promise { + try { + const msg = MsgStoreCode.fromJSON({ + ...params, + sender: this.injAddress, + }); + const result = await this.msgBroadcaster.broadcast({ msgs: msg }); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("msgStoreCodeError", err); + } +} + +/** + * Broadcasts a message to update the admin of a contract. + * + * @this InjectiveGrpcBase + * @param {WasmTypes.MsgUpdateAdminParams} params - Parameters including sender, contract address, and new admin address. + * @returns {Promise} The standard response containing the broadcast result or an error. + */ +export async function msgUpdateAdmin( + this: InjectiveGrpcBase, + params: WasmTypes.MsgUpdateAdminParams +): Promise { + try { + const msg = MsgUpdateAdmin.fromJSON({ + ...params, + sender: this.injAddress, + }); + const result = await this.msgBroadcaster.broadcast({ msgs: msg }); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("msgUpdateAdminError", err); + } +} + +/** + * Broadcasts a message to execute a contract. + * + * @this InjectiveGrpcBase + * @param {WasmTypes.MsgExecuteContractParams} params - Parameters including sender, contract address, and execute message. + * @returns {Promise} The standard response containing the broadcast result or an error. + */ +export async function msgExecuteContract( + this: InjectiveGrpcBase, + params: WasmTypes.MsgExecuteContractParams +): Promise { + try { + const msg = MsgExecuteContract.fromJSON({ + ...params, + sender: this.injAddress, + }); + const result = await this.msgBroadcaster.broadcast({ msgs: msg }); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("msgExecuteContractError", err); + } +} + +/** + * Broadcasts a message to migrate a contract to a new code version. + * + * @this InjectiveGrpcBase + * @param {WasmTypes.MsgMigrateContractParams} params - Parameters including sender, contract address, new code ID, and migrate message. + * @returns {Promise} The standard response containing the broadcast result or an error. + */ +export async function msgMigrateContract( + this: InjectiveGrpcBase, + params: WasmTypes.MsgMigrateContractParams +): Promise { + try { + const msg = MsgMigrateContract.fromJSON({ + ...params, + sender: this.injAddress, + }); + const result = await this.msgBroadcaster.broadcast({ msgs: msg }); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("msgMigrateContractError", err); + } +} + +/** + * Broadcasts a message to instantiate a new contract. + * + * @this InjectiveGrpcBase + * @param {WasmTypes.MsgInstantiateContractParams} params - Parameters including sender, code ID, instantiate message, and label. + * @returns {Promise} The standard response containing the broadcast result or an error. + */ +export async function msgInstantiateContract( + this: InjectiveGrpcBase, + params: WasmTypes.MsgInstantiateContractParams +): Promise { + try { + const msg = MsgInstantiateContract.fromJSON({ + ...params, + sender: this.injAddress, + }); + const result = await this.msgBroadcaster.broadcast({ msgs: msg }); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("msgInstantiateContractError", err); + } +} + +/** + * Broadcasts a message to execute a contract using compatibility mode. + * + * @this InjectiveGrpcBase + * @param {WasmTypes.MsgExecuteContractCompatParams} params - Parameters including sender, contract address, and execute message. + * @returns {Promise} The standard response containing the broadcast result or an error. + */ +export async function msgExecuteContractCompat( + this: InjectiveGrpcBase, + params: WasmTypes.MsgExecuteContractCompatParams +): Promise { + try { + const msg = MsgExecuteContractCompat.fromJSON({ + ...params, + sender: this.injAddress, + }); + const result = await this.msgBroadcaster.broadcast({ msgs: msg }); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("msgExecuteContractCompatError", err); + } +} + +/** + * Broadcasts a privileged message to execute a contract. + * + * @this InjectiveGrpcBase + * @param {WasmTypes.MsgPrivilegedExecuteContractParams} params - Parameters including sender, contract address, and execute message. + * @returns {Promise} The standard response containing the broadcast result or an error. + */ +export async function msgPrivilegedExecuteContract( + this: InjectiveGrpcBase, + params: WasmTypes.MsgPrivilegedExecuteContractParams +): Promise { + try { + const msg = MsgPrivilegedExecuteContract.fromJSON({ + ...params, + sender: this.injAddress, + }); + const result = await this.msgBroadcaster.broadcast({ msgs: msg }); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("msgPrivilegedExecuteContractError", err); + } +} diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/modules/wasmx.ts b/packages/plugin-injective/injective-sdk-client-ts/src/modules/wasmx.ts new file mode 100644 index 00000000000..1fb8b2cab83 --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/modules/wasmx.ts @@ -0,0 +1,44 @@ +import { InjectiveGrpcBase } from "../grpc/grpc-base"; +import { + StandardResponse, + createSuccessResponse, + createErrorResponse, +} from "../types/index"; + +/** + * WasmX Module Async Functions with Error Handling + */ + +/** + * Fetches the parameters of the WasmX module. + * + * @this InjectiveGrpcBase + * @returns {Promise} The standard response containing module parameters or an error. + */ +export async function getWasmxModuleParams( + this: InjectiveGrpcBase +): Promise { + try { + const result = await this.chainGrpcWasmXApi.fetchModuleParams(); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getWasmxModuleParamsError", err); + } +} + +/** + * Fetches the current state of the WasmX module. + * + * @this InjectiveGrpcBase + * @returns {Promise} The standard response containing module state or an error. + */ +export async function getWasmxModuleState( + this: InjectiveGrpcBase +): Promise { + try { + const result = await this.chainGrpcWasmXApi.fetchModuleState(); + return createSuccessResponse(result); + } catch (err) { + return createErrorResponse("getWasmxModuleStateError", err); + } +} diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/similes/auction.ts b/packages/plugin-injective/injective-sdk-client-ts/src/similes/auction.ts new file mode 100644 index 00000000000..18ef0afa1d8 --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/similes/auction.ts @@ -0,0 +1,71 @@ +export const getAuctionModuleParamsSimiles = [ + "VIEW_PARAMS", + "GET_PARAMS", + "CHECK_PARAMS", + "FETCH_PARAMS", + "READ_PARAMS", + "DISPLAY_PARAMS", + "SHOW_PARAMS", + "LIST_PARAMS", + "RETRIEVE_PARAMS", +]; + +export const getAuctionModuleStateSimiles = [ + "VIEW_STATE", + "GET_STATE", + "CHECK_STATE", + "FETCH_STATE", + "READ_STATE", + "DISPLAY_STATE", + "SHOW_STATE", + "LIST_STATE", + "RETRIEVE_STATE", +]; + +export const getCurrentBasketSimiles = [ + "VIEW_BASKET", + "GET_BASKET", + "CHECK_BASKET", + "FETCH_BASKET", + "READ_BASKET", + "DISPLAY_BASKET", + "SHOW_BASKET", + "LIST_BASKET", + "RETRIEVE_BASKET", +]; + +export const getAuctionRoundSimiles = [ + "VIEW_ROUND", + "GET_ROUND", + "CHECK_ROUND", + "FETCH_ROUND", + "READ_ROUND", + "DISPLAY_ROUND", + "SHOW_ROUND", + "LIST_ROUND", + "RETRIEVE_ROUND", +]; + +export const getAuctionsSimiles = [ + "VIEW_AUCTIONS", + "GET_AUCTIONS", + "CHECK_AUCTIONS", + "FETCH_AUCTIONS", + "READ_AUCTIONS", + "DISPLAY_AUCTIONS", + "SHOW_AUCTIONS", + "LIST_AUCTIONS", + "RETRIEVE_AUCTIONS", +]; + +export const MsgBidSimiles = [ + "PLACE_BID", + "SUBMIT_BID", + "SEND_BID", + "MAKE_BID", + "CREATE_BID", + "START_BID", + "ENTER_BID", + "POST_BID", + "REGISTER_BID", +]; diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/similes/auth.ts b/packages/plugin-injective/injective-sdk-client-ts/src/similes/auth.ts new file mode 100644 index 00000000000..8d189a10f47 --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/similes/auth.ts @@ -0,0 +1,107 @@ +export const getAuthModuleParamsSimiles = [ + "VIEW_AUTH_PARAMS", + "GET_AUTH_PARAMS", + "CHECK_AUTH_PARAMS", + "FETCH_AUTH_PARAMS", + "READ_AUTH_PARAMS", + "DISPLAY_AUTH_PARAMS", + "SHOW_AUTH_PARAMS", + "LIST_AUTH_PARAMS", + "RETRIEVE_AUTH_PARAMS", +]; + +export const getAccountDetailsSimiles = [ + "VIEW_AUTH_ACCOUNT", + "GET_AUTH_ACCOUNT", + "CHECK_AUTH_ACCOUNT", + "FETCH_AUTH_ACCOUNT", + "READ_AUTH_ACCOUNT", + "DISPLAY_AUTH_ACCOUNT", + "SHOW_AUTH_ACCOUNT", + "LIST_AUTH_ACCOUNT", + "RETRIEVE_AUTH_ACCOUNT", +]; + +export const getAccountsSimiles = [ + "VIEW_AUTH_ACCOUNTS", + "GET_AUTH_ACCOUNTS", + "CHECK_AUTH_ACCOUNTS", + "FETCH_AUTH_ACCOUNTS", + "READ_AUTH_ACCOUNTS", + "DISPLAY_AUTH_ACCOUNTS", + "SHOW_AUTH_ACCOUNTS", + "LIST_AUTH_ACCOUNTS", + "RETRIEVE_AUTH_ACCOUNTS", +]; + +export const getGrantsSimiles = [ + "VIEW_AUTH_GRANTS", + "GET_AUTH_GRANTS", + "CHECK_AUTH_GRANTS", + "FETCH_AUTH_GRANTS", + "READ_AUTH_GRANTS", + "DISPLAY_AUTH_GRANTS", + "SHOW_AUTH_GRANTS", + "LIST_AUTH_GRANTS", + "RETRIEVE_AUTH_GRANTS", +]; + +export const getGranterGrantsSimiles = [ + "VIEW_GRANTER_GRANTS", + "GET_GRANTER_GRANTS", + "CHECK_GRANTER_GRANTS", + "FETCH_GRANTER_GRANTS", + "READ_GRANTER_GRANTS", + "DISPLAY_GRANTER_GRANTS", + "SHOW_GRANTER_GRANTS", + "LIST_GRANTER_GRANTS", + "RETRIEVE_GRANTER_GRANTS", +]; + +export const getGranteeGrantsSimiles = [ + "VIEW_GRANTEE_GRANTS", + "GET_GRANTEE_GRANTS", + "CHECK_GRANTEE_GRANTS", + "FETCH_GRANTEE_GRANTS", + "READ_GRANTEE_GRANTS", + "DISPLAY_GRANTEE_GRANTS", + "SHOW_GRANTEE_GRANTS", + "LIST_GRANTEE_GRANTS", + "RETRIEVE_GRANTEE_GRANTS", +]; + +export const msgGrantSimiles = [ + "CREATE_AUTH_GRANT", + "MAKE_AUTH_GRANT", + "SET_AUTH_GRANT", + "START_AUTH_GRANT", + "BEGIN_AUTH_GRANT", + "INIT_AUTH_GRANT", + "ASSIGN_AUTH_GRANT", + "ENABLE_AUTH_GRANT", + "REGISTER_AUTH_GRANT", +]; + +export const msgExecSimiles = [ + "EXECUTE_AUTH_ACTION", + "RUN_AUTH_ACTION", + "PERFORM_AUTH_ACTION", + "START_AUTH_ACTION", + "BEGIN_AUTH_ACTION", + "TRIGGER_AUTH_ACTION", + "LAUNCH_AUTH_ACTION", + "PROCESS_AUTH_ACTION", + "INITIATE_AUTH_ACTION", +]; + +export const msgRevokeSimiles = [ + "REVOKE_AUTH_GRANT", + "REMOVE_AUTH_GRANT", + "CANCEL_AUTH_GRANT", + "DELETE_AUTH_GRANT", + "STOP_AUTH_GRANT", + "END_AUTH_GRANT", + "DISABLE_AUTH_GRANT", + "WITHDRAW_AUTH_GRANT", + "TERMINATE_AUTH_GRANT", +]; diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/similes/bank.ts b/packages/plugin-injective/injective-sdk-client-ts/src/similes/bank.ts new file mode 100644 index 00000000000..9d25dc30d8e --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/similes/bank.ts @@ -0,0 +1,131 @@ +export const getBankModuleParamsSimiles = [ + "VIEW_BANK_PARAMS", + "GET_BANK_PARAMS", + "CHECK_BANK_PARAMS", + "FETCH_BANK_PARAMS", + "READ_BANK_PARAMS", + "DISPLAY_BANK_PARAMS", + "SHOW_BANK_PARAMS", + "LIST_BANK_PARAMS", + "RETRIEVE_BANK_PARAMS", +]; + +export const getBankBalanceSimiles = [ + "VIEW_BANK_BALANCE", + "GET_BANK_BALANCE", + "CHECK_BANK_BALANCE", + "FETCH_BANK_BALANCE", + "READ_BANK_BALANCE", + "DISPLAY_BANK_BALANCE", + "SHOW_BANK_BALANCE", + "LIST_BANK_BALANCE", + "RETRIEVE_BANK_BALANCE", +]; + +export const getBankBalancesSimiles = [ + "VIEW_BANK_BALANCES", + "GET_BANK_BALANCES", + "CHECK_BANK_BALANCES", + "FETCH_BANK_BALANCES", + "READ_BANK_BALANCES", + "DISPLAY_BANK_BALANCES", + "SHOW_BANK_BALANCES", + "LIST_BANK_BALANCES", + "RETRIEVE_BANK_BALANCES", +]; + +export const getTotalSupplySimiles = [ + "VIEW_BANK_SUPPLY", + "GET_BANK_SUPPLY", + "CHECK_BANK_SUPPLY", + "FETCH_BANK_SUPPLY", + "READ_BANK_SUPPLY", + "DISPLAY_BANK_SUPPLY", + "SHOW_BANK_SUPPLY", + "LIST_BANK_SUPPLY", + "RETRIEVE_BANK_SUPPLY", +]; + +export const getAllTotalSupplySimiles = [ + "VIEW_BANK_SUPPLIES", + "GET_BANK_SUPPLIES", + "CHECK_BANK_SUPPLIES", + "FETCH_BANK_SUPPLIES", + "READ_BANK_SUPPLIES", + "DISPLAY_BANK_SUPPLIES", + "SHOW_BANK_SUPPLIES", + "LIST_BANK_SUPPLIES", + "RETRIEVE_BANK_SUPPLIES", +]; + +export const getSupplyOfSimiles = [ + "VIEW_TOKEN_SUPPLY", + "GET_TOKEN_SUPPLY", + "CHECK_TOKEN_SUPPLY", + "FETCH_TOKEN_SUPPLY", + "READ_TOKEN_SUPPLY", + "DISPLAY_TOKEN_SUPPLY", + "SHOW_TOKEN_SUPPLY", + "LIST_TOKEN_SUPPLY", + "RETRIEVE_TOKEN_SUPPLY", +]; + +export const getDenomsMetadataSimiles = [ + "VIEW_BANK_DENOMS", + "GET_BANK_DENOMS", + "CHECK_BANK_DENOMS", + "FETCH_BANK_DENOMS", + "READ_BANK_DENOMS", + "DISPLAY_BANK_DENOMS", + "SHOW_BANK_DENOMS", + "LIST_BANK_DENOMS", + "RETRIEVE_BANK_DENOMS", +]; + +export const getDenomMetadataSimiles = [ + "VIEW_BANK_DENOM", + "GET_BANK_DENOM", + "CHECK_BANK_DENOM", + "FETCH_BANK_DENOM", + "READ_BANK_DENOM", + "DISPLAY_BANK_DENOM", + "SHOW_BANK_DENOM", + "LIST_BANK_DENOM", + "RETRIEVE_BANK_DENOM", +]; + +export const getDenomOwnersSimiles = [ + "VIEW_DENOM_OWNERS", + "GET_DENOM_OWNERS", + "CHECK_DENOM_OWNERS", + "FETCH_DENOM_OWNERS", + "READ_DENOM_OWNERS", + "DISPLAY_DENOM_OWNERS", + "SHOW_DENOM_OWNERS", + "LIST_DENOM_OWNERS", + "RETRIEVE_DENOM_OWNERS", +]; + +export const msgSendSimiles = [ + "SEND_BANK_TOKENS", + "TRANSFER_BANK_TOKENS", + "MOVE_BANK_TOKENS", + "SUBMIT_BANK_TRANSFER", + "CREATE_BANK_TRANSFER", + "EXECUTE_BANK_TRANSFER", + "PROCESS_BANK_TRANSFER", + "INITIATE_BANK_TRANSFER", + "PERFORM_BANK_TRANSFER", +]; + +export const msgMultiSendSimiles = [ + "SEND_MULTIPLE_TOKENS", + "TRANSFER_MULTIPLE_TOKENS", + "MOVE_MULTIPLE_TOKENS", + "SUBMIT_MULTIPLE_TRANSFERS", + "CREATE_MULTIPLE_TRANSFERS", + "EXECUTE_MULTIPLE_TRANSFERS", + "PROCESS_MULTIPLE_TRANSFERS", + "INITIATE_MULTIPLE_TRANSFERS", + "PERFORM_MULTIPLE_TRANSFERS", +]; diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/similes/distribution.ts b/packages/plugin-injective/injective-sdk-client-ts/src/similes/distribution.ts new file mode 100644 index 00000000000..1a2673893ec --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/similes/distribution.ts @@ -0,0 +1,83 @@ +export const getDistributionModuleParamsSimiles = [ + "VIEW_DISTRIBUTION_PARAMS", + "GET_DISTRIBUTION_PARAMS", + "CHECK_DISTRIBUTION_PARAMS", + "FETCH_DISTRIBUTION_PARAMS", + "READ_DISTRIBUTION_PARAMS", + "DISPLAY_DISTRIBUTION_PARAMS", + "SHOW_DISTRIBUTION_PARAMS", + "LIST_DISTRIBUTION_PARAMS", + "RETRIEVE_DISTRIBUTION_PARAMS", +]; + +export const getDelegatorRewardsForValidatorSimiles = [ + "VIEW_VALIDATOR_REWARDS", + "GET_VALIDATOR_REWARDS", + "CHECK_VALIDATOR_REWARDS", + "FETCH_VALIDATOR_REWARDS", + "READ_VALIDATOR_REWARDS", + "DISPLAY_VALIDATOR_REWARDS", + "SHOW_VALIDATOR_REWARDS", + "LIST_VALIDATOR_REWARDS", + "RETRIEVE_VALIDATOR_REWARDS", +]; + +export const getDelegatorRewardsForValidatorNoThrowSimiles = [ + "VIEW_VALIDATOR_REWARDS_SAFE", + "GET_VALIDATOR_REWARDS_SAFE", + "CHECK_VALIDATOR_REWARDS_SAFE", + "FETCH_VALIDATOR_REWARDS_SAFE", + "READ_VALIDATOR_REWARDS_SAFE", + "DISPLAY_VALIDATOR_REWARDS_SAFE", + "SHOW_VALIDATOR_REWARDS_SAFE", + "LIST_VALIDATOR_REWARDS_SAFE", + "RETRIEVE_VALIDATOR_REWARDS_SAFE", +]; + +export const getDelegatorRewardsSimiles = [ + "VIEW_DELEGATOR_REWARDS", + "GET_DELEGATOR_REWARDS", + "CHECK_DELEGATOR_REWARDS", + "FETCH_DELEGATOR_REWARDS", + "READ_DELEGATOR_REWARDS", + "DISPLAY_DELEGATOR_REWARDS", + "SHOW_DELEGATOR_REWARDS", + "LIST_DELEGATOR_REWARDS", + "RETRIEVE_DELEGATOR_REWARDS", +]; + +export const getDelegatorRewardsNoThrowSimiles = [ + "VIEW_DELEGATOR_REWARDS_SAFE", + "GET_DELEGATOR_REWARDS_SAFE", + "CHECK_DELEGATOR_REWARDS_SAFE", + "FETCH_DELEGATOR_REWARDS_SAFE", + "READ_DELEGATOR_REWARDS_SAFE", + "DISPLAY_DELEGATOR_REWARDS_SAFE", + "SHOW_DELEGATOR_REWARDS_SAFE", + "LIST_DELEGATOR_REWARDS_SAFE", + "RETRIEVE_DELEGATOR_REWARDS_SAFE", +]; + +export const msgWithdrawDelegatorRewardSimiles = [ + "WITHDRAW_DELEGATOR_REWARDS", + "CLAIM_DELEGATOR_REWARDS", + "COLLECT_DELEGATOR_REWARDS", + "FETCH_DELEGATOR_REWARDS", + "REQUEST_DELEGATOR_REWARDS", + "RETRIEVE_DELEGATOR_REWARDS", + "PROCESS_DELEGATOR_REWARDS", + "EXTRACT_DELEGATOR_REWARDS", + "RELEASE_DELEGATOR_REWARDS", +]; + +export const msgWithdrawValidatorCommissionSimiles = [ + "WITHDRAW_VALIDATOR_COMMISSION", + "CLAIM_VALIDATOR_COMMISSION", + "COLLECT_VALIDATOR_COMMISSION", + "FETCH_VALIDATOR_COMMISSION", + "REQUEST_VALIDATOR_COMMISSION", + "RETRIEVE_VALIDATOR_COMMISSION", + "PROCESS_VALIDATOR_COMMISSION", + "EXTRACT_VALIDATOR_COMMISSION", + "RELEASE_VALIDATOR_COMMISSION", +]; diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/similes/exchange.ts b/packages/plugin-injective/injective-sdk-client-ts/src/similes/exchange.ts new file mode 100644 index 00000000000..3e2613413d7 --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/similes/exchange.ts @@ -0,0 +1,852 @@ +// Module Parameters and State +export const getModuleParamsSimiles = [ + "VIEW_EXCHANGE_PARAMS", + "GET_EXCHANGE_PARAMS", + "CHECK_EXCHANGE_PARAMS", + "FETCH_EXCHANGE_PARAMS", + "READ_EXCHANGE_PARAMS", + "DISPLAY_EXCHANGE_PARAMS", + "SHOW_EXCHANGE_PARAMS", + "LIST_EXCHANGE_PARAMS", + "RETRIEVE_EXCHANGE_PARAMS", +]; + +export const getModuleStateSimiles = [ + "VIEW_EXCHANGE_STATE", + "GET_EXCHANGE_STATE", + "CHECK_EXCHANGE_STATE", + "FETCH_EXCHANGE_STATE", + "READ_EXCHANGE_STATE", + "DISPLAY_EXCHANGE_STATE", + "SHOW_EXCHANGE_STATE", + "LIST_EXCHANGE_STATE", + "RETRIEVE_EXCHANGE_STATE", +]; + +// Fee Discounts +export const getFeeDiscountScheduleSimiles = [ + "VIEW_DISCOUNT_SCHEDULE", + "GET_DISCOUNT_SCHEDULE", + "CHECK_DISCOUNT_SCHEDULE", + "FETCH_DISCOUNT_SCHEDULE", + "READ_DISCOUNT_SCHEDULE", + "DISPLAY_DISCOUNT_SCHEDULE", + "SHOW_DISCOUNT_SCHEDULE", + "LIST_DISCOUNT_SCHEDULE", + "RETRIEVE_DISCOUNT_SCHEDULE", +]; + +export const getFeeDiscountAccountInfoSimiles = [ + "VIEW_DISCOUNT_INFO", + "GET_DISCOUNT_INFO", + "CHECK_DISCOUNT_INFO", + "FETCH_DISCOUNT_INFO", + "READ_DISCOUNT_INFO", + "DISPLAY_DISCOUNT_INFO", + "SHOW_DISCOUNT_INFO", + "LIST_DISCOUNT_INFO", + "RETRIEVE_DISCOUNT_INFO", +]; + +// Trading Rewards +export const getTradingRewardsCampaignSimiles = [ + "VIEW_REWARDS_CAMPAIGN", + "GET_REWARDS_CAMPAIGN", + "CHECK_REWARDS_CAMPAIGN", + "FETCH_REWARDS_CAMPAIGN", + "READ_REWARDS_CAMPAIGN", + "DISPLAY_REWARDS_CAMPAIGN", + "SHOW_REWARDS_CAMPAIGN", + "LIST_REWARDS_CAMPAIGN", + "RETRIEVE_REWARDS_CAMPAIGN", +]; + +export const getTradeRewardPointsSimiles = [ + "VIEW_REWARD_POINTS", + "GET_REWARD_POINTS", + "CHECK_REWARD_POINTS", + "FETCH_REWARD_POINTS", + "READ_REWARD_POINTS", + "DISPLAY_REWARD_POINTS", + "SHOW_REWARD_POINTS", + "LIST_REWARD_POINTS", + "RETRIEVE_REWARD_POINTS", +]; + +export const getPendingTradeRewardPointsSimiles = [ + "VIEW_PENDING_REWARDS", + "GET_PENDING_REWARDS", + "CHECK_PENDING_REWARDS", + "FETCH_PENDING_REWARDS", + "READ_PENDING_REWARDS", + "DISPLAY_PENDING_REWARDS", + "SHOW_PENDING_REWARDS", + "LIST_PENDING_REWARDS", + "RETRIEVE_PENDING_REWARDS", +]; + +// Orderbooks +export const getDerivativeOrderbooksSimiles = [ + "VIEW_DERIVATIVE_BOOKS", + "GET_DERIVATIVE_BOOKS", + "CHECK_DERIVATIVE_BOOKS", + "FETCH_DERIVATIVE_BOOKS", + "READ_DERIVATIVE_BOOKS", + "DISPLAY_DERIVATIVE_BOOKS", + "SHOW_DERIVATIVE_BOOKS", + "LIST_DERIVATIVE_BOOKS", + "RETRIEVE_DERIVATIVE_BOOKS", +]; + +export const getDerivativeOrderbookSimiles = [ + "VIEW_DERIVATIVE_BOOK", + "GET_DERIVATIVE_BOOK", + "CHECK_DERIVATIVE_BOOK", + "FETCH_DERIVATIVE_BOOK", + "READ_DERIVATIVE_BOOK", + "DISPLAY_DERIVATIVE_BOOK", + "SHOW_DERIVATIVE_BOOK", + "LIST_DERIVATIVE_BOOK", + "RETRIEVE_DERIVATIVE_BOOK", +]; + +export const getSpotOrderbooksSimiles = [ + "VIEW_SPOT_BOOKS", + "GET_SPOT_BOOKS", + "CHECK_SPOT_BOOKS", + "FETCH_SPOT_BOOKS", + "READ_SPOT_BOOKS", + "DISPLAY_SPOT_BOOKS", + "SHOW_SPOT_BOOKS", + "LIST_SPOT_BOOKS", + "RETRIEVE_SPOT_BOOKS", +]; + +export const getSpotOrderbookSimiles = [ + "VIEW_SPOT_BOOK", + "GET_SPOT_BOOK", + "CHECK_SPOT_BOOK", + "FETCH_SPOT_BOOK", + "READ_SPOT_BOOK", + "DISPLAY_SPOT_BOOK", + "SHOW_SPOT_BOOK", + "LIST_SPOT_BOOK", + "RETRIEVE_SPOT_BOOK", +]; + +// Spot Markets +export const getSpotMarketsSimiles = [ + "VIEW_SPOT_MARKETS", + "GET_SPOT_MARKETS", + "CHECK_SPOT_MARKETS", + "FETCH_SPOT_MARKETS", + "READ_SPOT_MARKETS", + "DISPLAY_SPOT_MARKETS", + "SHOW_SPOT_MARKETS", + "LIST_SPOT_MARKETS", + "RETRIEVE_SPOT_MARKETS", +]; + +export const getSpotMarketSimiles = [ + "VIEW_SPOT_MARKET", + "GET_SPOT_MARKET", + "CHECK_SPOT_MARKET", + "FETCH_SPOT_MARKET", + "READ_SPOT_MARKET", + "DISPLAY_SPOT_MARKET", + "SHOW_SPOT_MARKET", + "LIST_SPOT_MARKET", + "RETRIEVE_SPOT_MARKET", +]; + +export const getSpotOrdersSimiles = [ + "VIEW_SPOT_ORDERS", + "GET_SPOT_ORDERS", + "CHECK_SPOT_ORDERS", + "FETCH_SPOT_ORDERS", + "READ_SPOT_ORDERS", + "DISPLAY_SPOT_ORDERS", + "SHOW_SPOT_ORDERS", + "LIST_SPOT_ORDERS", + "RETRIEVE_SPOT_ORDERS", +]; + +export const getSpotOrderHistorySimiles = [ + "VIEW_SPOT_HISTORY", + "GET_SPOT_HISTORY", + "CHECK_SPOT_HISTORY", + "FETCH_SPOT_HISTORY", + "READ_SPOT_HISTORY", + "DISPLAY_SPOT_HISTORY", + "SHOW_SPOT_HISTORY", + "LIST_SPOT_HISTORY", + "RETRIEVE_SPOT_HISTORY", +]; + +export const getSpotTradesSimiles = [ + "VIEW_SPOT_TRADES", + "GET_SPOT_TRADES", + "CHECK_SPOT_TRADES", + "FETCH_SPOT_TRADES", + "READ_SPOT_TRADES", + "DISPLAY_SPOT_TRADES", + "SHOW_SPOT_TRADES", + "LIST_SPOT_TRADES", + "RETRIEVE_SPOT_TRADES", +]; + +// Derivative Markets +export const getDerivativeMarketsSimiles = [ + "VIEW_DERIVATIVE_MARKETS", + "GET_DERIVATIVE_MARKETS", + "CHECK_DERIVATIVE_MARKETS", + "FETCH_DERIVATIVE_MARKETS", + "READ_DERIVATIVE_MARKETS", + "DISPLAY_DERIVATIVE_MARKETS", + "SHOW_DERIVATIVE_MARKETS", + "LIST_DERIVATIVE_MARKETS", + "RETRIEVE_DERIVATIVE_MARKETS", +]; + +export const getDerivativeMarketSimiles = [ + "VIEW_DERIVATIVE_MARKET", + "GET_DERIVATIVE_MARKET", + "CHECK_DERIVATIVE_MARKET", + "FETCH_DERIVATIVE_MARKET", + "READ_DERIVATIVE_MARKET", + "DISPLAY_DERIVATIVE_MARKET", + "SHOW_DERIVATIVE_MARKET", + "LIST_DERIVATIVE_MARKET", + "RETRIEVE_DERIVATIVE_MARKET", +]; + +export const getDerivativeOrdersSimiles = [ + "VIEW_DERIVATIVE_ORDERS", + "GET_DERIVATIVE_ORDERS", + "CHECK_DERIVATIVE_ORDERS", + "FETCH_DERIVATIVE_ORDERS", + "READ_DERIVATIVE_ORDERS", + "DISPLAY_DERIVATIVE_ORDERS", + "SHOW_DERIVATIVE_ORDERS", + "LIST_DERIVATIVE_ORDERS", + "RETRIEVE_DERIVATIVE_ORDERS", +]; + +export const getDerivativeOrderHistorySimiles = [ + "VIEW_DERIVATIVE_ORDER_HISTORY", + "GET_DERIVATIVE_ORDER_HISTORY", + "CHECK_DERIVATIVE_ORDER_HISTORY", + "FETCH_DERIVATIVE_ORDER_HISTORY", + "READ_DERIVATIVE_ORDER_HISTORY", + "DISPLAY_DERIVATIVE_ORDER_HISTORY", + "SHOW_DERIVATIVE_ORDER_HISTORY", + "LIST_DERIVATIVE_ORDER_HISTORY", + "RETRIEVE_DERIVATIVE_ORDER_HISTORY", +]; + +export const getDerivativeTradesSimiles = [ + "VIEW_DERIVATIVE_TRADES", + "GET_DERIVATIVE_TRADES", + "CHECK_DERIVATIVE_TRADES", + "FETCH_DERIVATIVE_TRADES", + "READ_DERIVATIVE_TRADES", + "DISPLAY_DERIVATIVE_TRADES", + "SHOW_DERIVATIVE_TRADES", + "LIST_DERIVATIVE_TRADES", + "RETRIEVE_DERIVATIVE_TRADES", +]; + +// Binary Options +export const getBinaryOptionsMarketsSimiles = [ + "VIEW_BINARY_OPTIONS_MARKET", + "GET_BINARY_OPTIONS_MARKET", + "CHECK_BINARY_OPTIONS_MARKET", + "FETCH_BINARY_OPTIONS_MARKET", + "READ_BINARY_OPTIONS_MARKET", + "DISPLAY_BINARY_OPTIONS_MARKET", + "SHOW_BINARY_OPTIONS_MARKET", + "LIST_BINARY_OPTIONS_MARKET", + "RETRIEVE_BINARY_OPTIONS_MARKET", +]; + +export const getBinaryOptionsMarketSimiles = [ + "VIEW_BINARY_OPTIONS", + "GET_BINARY_OPTIONS", + "CHECK_BINARY_OPTIONS", + "FETCH_BINARY_OPTIONS", + "READ_BINARY_OPTIONS", + "DISPLAY_BINARY_OPTIONS", + "SHOW_BINARY_OPTIONS", + "LIST_BINARY_OPTIONS", + "RETRIEVE_BINARY_OPTIONS", +]; + +// Positions +export const getExchangePositionsSimiles = [ + "VIEW_EXCHANGE_POSITIONS", + "GET_EXCHANGE_POSITIONS", + "CHECK_EXCHANGE_POSITIONS", + "FETCH_EXCHANGE_POSITIONS", + "READ_EXCHANGE_POSITIONS", + "DISPLAY_EXCHANGE_POSITIONS", + "SHOW_EXCHANGE_POSITIONS", + "LIST_EXCHANGE_POSITIONS", + "RETRIEVE_EXCHANGE_POSITIONS", +]; +// Positions +export const getUserPositionsSimiles = [ + "VIEW_USER_POSITIONS", + "GET_USER_POSITIONS", + "CHECK_USER_POSITIONS", + "FETCH_USER_POSITIONS", + "READ_USER_POSITIONS", + "DISPLAY_USER_POSITIONS", + "SHOW_USER_POSITIONS", + "LIST_USER_POSITIONS", + "RETRIEVE_USER_POSITIONS", +]; + +// Funding +export const getFundingPaymentsSimiles = [ + "VIEW_FUNDING_PAYMENTS", + "GET_FUNDING_PAYMENTS", + "CHECK_FUNDING_PAYMENTS", + "FETCH_FUNDING_PAYMENTS", + "READ_FUNDING_PAYMENTS", + "DISPLAY_FUNDING_PAYMENTS", + "SHOW_FUNDING_PAYMENTS", + "LIST_FUNDING_PAYMENTS", + "RETRIEVE_FUNDING_PAYMENTS", +]; + +export const getFundingRatesSimiles = [ + "VIEW_FUNDING_RATES", + "GET_FUNDING_RATES", + "CHECK_FUNDING_RATES", + "FETCH_FUNDING_RATES", + "READ_FUNDING_RATES", + "DISPLAY_FUNDING_RATES", + "SHOW_FUNDING_RATES", + "LIST_FUNDING_RATES", + "RETRIEVE_FUNDING_RATES", +]; + +// Subaccounts +export const getSubaccountTradeNonceSimiles = [ + "VIEW_TRADE_NONCE", + "GET_TRADE_NONCE", + "CHECK_TRADE_NONCE", + "FETCH_TRADE_NONCE", + "READ_TRADE_NONCE", + "DISPLAY_TRADE_NONCE", + "SHOW_TRADE_NONCE", + "LIST_TRADE_NONCE", + "RETRIEVE_TRADE_NONCE", +]; + +export const getSubaccountsListSimiles = [ + "VIEW_SUBACCOUNT_LIST", + "GET_SUBACCOUNT_LIST", + "CHECK_SUBACCOUNT_LIST", + "FETCH_SUBACCOUNT_LIST", + "READ_SUBACCOUNT_LIST", + "DISPLAY_SUBACCOUNT_LIST", + "SHOW_SUBACCOUNT_LIST", + "LIST_SUBACCOUNT_LIST", + "RETRIEVE_SUBACCOUNT_LIST", +]; + +export const getSubaccountBalancesListSimiles = [ + "VIEW_SUBACCOUNT_BALANCES", + "GET_SUBACCOUNT_BALANCES", + "CHECK_SUBACCOUNT_BALANCES", + "FETCH_SUBACCOUNT_BALANCES", + "READ_SUBACCOUNT_BALANCES", + "DISPLAY_SUBACCOUNT_BALANCES", + "SHOW_SUBACCOUNT_BALANCES", + "LIST_SUBACCOUNT_BALANCES", + "RETRIEVE_SUBACCOUNT_BALANCES", +]; + +export const getSubaccountHistorySimiles = [ + "VIEW_SUBACCOUNT_HISTORY", + "GET_SUBACCOUNT_HISTORY", + "CHECK_SUBACCOUNT_HISTORY", + "FETCH_SUBACCOUNT_HISTORY", + "READ_SUBACCOUNT_HISTORY", + "DISPLAY_SUBACCOUNT_HISTORY", + "SHOW_SUBACCOUNT_HISTORY", + "LIST_SUBACCOUNT_HISTORY", + "RETRIEVE_SUBACCOUNT_HISTORY", +]; + +export const getSubaccountOrderSummarySimiles = [ + "VIEW_ORDER_SUMMARY", + "GET_ORDER_SUMMARY", + "CHECK_ORDER_SUMMARY", + "FETCH_ORDER_SUMMARY", + "READ_ORDER_SUMMARY", + "DISPLAY_ORDER_SUMMARY", + "SHOW_ORDER_SUMMARY", + "LIST_ORDER_SUMMARY", + "RETRIEVE_ORDER_SUMMARY", +]; + +export const getOrderStatesSimiles = [ + "VIEW_ORDER_STATE", + "GET_ORDER_STATE", + "CHECK_ORDER_STATE", + "FETCH_ORDER_STATE", + "READ_ORDER_STATE", + "DISPLAY_ORDER_STATE", + "SHOW_ORDER_STATE", + "LIST_ORDER_STATE", + "RETRIEVE_ORDER_STATE", +]; + +export const getIsOptedOutOfRewardsSimiles = [ + "GET_IS_OPTED_OUT_OF_REWARDS", + "VIEW_IS_OPTED_OUT_OF_REWARDS", + "CHECK_IS_OPTED_OUT_OF_REWARDS", + "FETCH_IS_OPTED_OUT_OF_REWARDS", + "READ_IS_OPTED_OUT_OF_REWARDS", + "DISPLAY_IS_OPTED_OUT_OF_REWARDS", + "SHOW_IS_OPTED_OUT_OF_REWARDS", + "LIST_IS_OPTED_OUT_OF_REWARDS", +]; + +// Portfolio +export const getAccountPortfolioSimiles = [ + "VIEW_ACCOUNT_PORTFOLIO", + "GET_ACCOUNT_PORTFOLIO", + "CHECK_ACCOUNT_PORTFOLIO", + "FETCH_ACCOUNT_PORTFOLIO", + "READ_ACCOUNT_PORTFOLIO", + "DISPLAY_ACCOUNT_PORTFOLIO", + "SHOW_ACCOUNT_PORTFOLIO", + "LIST_ACCOUNT_PORTFOLIO", + "RETRIEVE_ACCOUNT_PORTFOLIO", +]; + +export const getAccountPortfolioBalancesSimiles = [ + "VIEW_PORTFOLIO_BALANCES", + "GET_PORTFOLIO_BALANCES", + "CHECK_PORTFOLIO_BALANCES", + "FETCH_PORTFOLIO_BALANCES", + "READ_PORTFOLIO_BALANCES", + "DISPLAY_PORTFOLIO_BALANCES", + "SHOW_PORTFOLIO_BALANCES", + "LIST_PORTFOLIO_BALANCES", + "RETRIEVE_PORTFOLIO_BALANCES", +]; + +// Historical Data +export const getHistoricalBalanceSimiles = [ + "VIEW_HISTORICAL_BALANCE", + "GET_HISTORICAL_BALANCE", + "CHECK_HISTORICAL_BALANCE", + "FETCH_HISTORICAL_BALANCE", + "READ_HISTORICAL_BALANCE", + "DISPLAY_HISTORICAL_BALANCE", + "SHOW_HISTORICAL_BALANCE", + "LIST_HISTORICAL_BALANCE", + "RETRIEVE_HISTORICAL_BALANCE", +]; + +export const getHistoricalRpnlSimiles = [ + "VIEW_HISTORICAL_RPNL", + "GET_HISTORICAL_RPNL", + "CHECK_HISTORICAL_RPNL", + "FETCH_HISTORICAL_RPNL", + "READ_HISTORICAL_RPNL", + "DISPLAY_HISTORICAL_RPNL", + "SHOW_HISTORICAL_RPNL", + "LIST_HISTORICAL_RPNL", + "RETRIEVE_HISTORICAL_RPNL", +]; +// Leaderboard +export const getPnlLeaderboardSimiles = [ + "VIEW_PNL_LEADERBOARD", + "GET_PNL_LEADERBOARD", + "CHECK_PNL_LEADERBOARD", + "FETCH_PNL_LEADERBOARD", + "READ_PNL_LEADERBOARD", + "DISPLAY_PNL_LEADERBOARD", + "SHOW_PNL_LEADERBOARD", + "LIST_PNL_LEADERBOARD", + "RETRIEVE_PNL_LEADERBOARD", +]; + +export const getVolLeaderboardSimiles = [ + "VIEW_VOLUME_LEADERBOARD", + "GET_VOLUME_LEADERBOARD", + "CHECK_VOLUME_LEADERBOARD", + "FETCH_VOLUME_LEADERBOARD", + "READ_VOLUME_LEADERBOARD", + "DISPLAY_VOLUME_LEADERBOARD", + "SHOW_VOLUME_LEADERBOARD", + "LIST_VOLUME_LEADERBOARD", + "RETRIEVE_VOLUME_LEADERBOARD", +]; + +// Message Actions - Order Management +export const msgBatchCancelBinaryOptionsOrdersSimiles = [ + "BATCH_CANCEL_BINARY_OPTIONS_ORDERS", + "BATCH_REMOVE_BINARY_OPTIONS_ORDERS", + "BATCH_DELETE_BINARY_OPTIONS_ORDERS", + "BATCH_STOP_BINARY_OPTIONS_ORDERS", + "BATCH_END_BINARY_OPTIONS_ORDERS", + "BATCH_CLEAR_BINARY_OPTIONS_ORDERS", + "BATCH_TERMINATE_BINARY_OPTIONS_ORDERS", + "BATCH_HALT_BINARY_OPTIONS_ORDERS", + "BATCH_CLOSE_BINARY_OPTIONS_ORDERS", +]; + +export const msgBatchCancelDerivativeOrdersSimiles = [ + "BATCH_CANCEL_DERIVATIVE_ORDERS", + "BATCH_REMOVE_DERIVATIVE_ORDERS", + "BATCH_DELETE_DERIVATIVE_ORDERS", + "BATCH_STOP_DERIVATIVE_ORDERS", + "BATCH_END_DERIVATIVE_ORDERS", + "BATCH_CLEAR_DERIVATIVE_ORDERS", + "BATCH_TERMINATE_DERIVATIVE_ORDERS", + "BATCH_HALT_DERIVATIVE_ORDERS", + "BATCH_CLOSE_DERIVATIVE_ORDERS", +]; + +export const msgBatchCancelSpotOrdersSimiles = [ + "BATCH_CANCEL_SPOT_ORDERS", + "BATCH_REMOVE_SPOT_ORDERS", + "BATCH_DELETE_SPOT_ORDERS", + "BATCH_STOP_SPOT_ORDERS", + "BATCH_END_SPOT_ORDERS", + "BATCH_CLEAR_SPOT_ORDERS", + "BATCH_TERMINATE_SPOT_ORDERS", + "BATCH_HALT_SPOT_ORDERS", + "BATCH_CLOSE_SPOT_ORDERS", +]; + +// Message Actions - Creating Orders +export const msgCreateBinaryOptionsLimitOrderSimiles = [ + "CREATE_BINARY_OPTIONS_LIMIT_ORDERS", + "PLACE_BINARY_OPTIONS_LIMIT_ORDERS", + "SUBMIT_BINARY_OPTIONS_LIMIT_ORDERS", + "START_BINARY_OPTIONS_LIMIT_ORDERS", + "OPEN_BINARY_OPTIONS_LIMIT_ORDERS", + "SET_BINARY_OPTIONS_LIMIT_ORDERS", + "MAKE_BINARY_OPTIONS_LIMIT_ORDERS", + "INITIALIZE_BINARY_OPTIONS_LIMIT_ORDERS", + "BEGIN_BINARY_OPTIONS_LIMIT_ORDERS", +]; + +export const msgCreateBinaryOptionsMarketOrderSimiles = [ + "CREATE_BINARY_OPTIONS_ORDERS", + "PLACE_BINARY_OPTIONS_ORDERS", + "SUBMIT_BINARY_OPTIONS_ORDERS", + "START_BINARY_OPTIONS_ORDERS", + "OPEN_BINARY_OPTIONS_ORDERS", + "SET_BINARY_OPTIONS_ORDERS", + "MAKE_BINARY_OPTIONS_ORDERS", + "INITIALIZE_BINARY_OPTIONS_ORDERS", + "BEGIN_BINARY_OPTIONS_ORDERS", +]; + +export const msgCreateDerivativeLimitOrderSimiles = [ + "CREATE_DERIVATIVE_LIMIT_ORDERS", + "PLACE_DERIVATIVE_LIMIT_ORDERS", + "SUBMIT_DERIVATIVE_LIMIT_ORDERS", + "START_DERIVATIVE_LIMIT_ORDERS", + "OPEN_DERIVATIVE_LIMIT_ORDERS", + "SET_DERIVATIVE_LIMIT_ORDERS", + "MAKE_DERIVATIVE_LIMIT_ORDERS", + "INITIALIZE_DERIVATIVE_LIMIT_ORDERS", + "BEGIN_DERIVATIVE_LIMIT_ORDERS", +]; + +export const msgCreateDerivativeMarketOrderSimiles = [ + "CREATE_DERIVATIVE_MARKET_ORDERS", + "PLACE_DERIVATIVE_MARKET_ORDERS", + "SUBMIT_DERIVATIVE_MARKET_ORDERS", + "START_DERIVATIVE_MARKET_ORDERS", + "OPEN_DERIVATIVE_MARKET_ORDERS", + "SET_DERIVATIVE_MARKET_ORDERS", + "MAKE_DERIVATIVE_MARKET_ORDERS", + "INITIALIZE_DERIVATIVE_MARKET_ORDERS", + "BEGIN_DERIVATIVE_MARKET_ORDERS", +]; + +export const msgCreateSpotLimitOrderSimiles = [ + "CREATE_SPOT_LIMIT_ORDERS", + "PLACE_SPOT_LIMIT_ORDERS", + "SUBMIT_SPOT_LIMIT_ORDERS", + "START_SPOT_LIMIT_ORDERS", + "OPEN_SPOT_LIMIT_ORDERS", + "SET_SPOT_LIMIT_ORDERS", + "MAKE_SPOT_LIMIT_ORDERS", + "INITIALIZE_SPOT_LIMIT_ORDERS", + "BEGIN_SPOT_LIMIT_ORDERS", +]; + +export const msgCreateSpotMarketOrderSimiles = [ + "CREATE_SPOT_MARKET_ORDERS", + "PLACE_SPOT_MARKET_ORDERS", + "SUBMIT_SPOT_MARKET_ORDERS", + "START_SPOT_MARKET_ORDERS", + "OPEN_SPOT_MARKET_ORDERS", + "SET_SPOT_MARKET_ORDERS", + "MAKE_SPOT_MARKET_ORDERS", + "INITIALIZE_SPOT_MARKET_ORDERS", + "BEGIN_SPOT_MARKET_ORDERS", +]; +// Deposit and Withdrawal Actions +export const msgDepositSimiles = [ + "CREATE_EXCHANGE_DEPOSIT", + "MAKE_EXCHANGE_DEPOSIT", + "SUBMIT_EXCHANGE_DEPOSIT", + "START_EXCHANGE_DEPOSIT", + "OPEN_EXCHANGE_DEPOSIT", + "SET_EXCHANGE_DEPOSIT", + "PROCESS_EXCHANGE_DEPOSIT", + "INITIALIZE_EXCHANGE_DEPOSIT", + "BEGIN_EXCHANGE_DEPOSIT", +]; + +export const msgWithdrawSimiles = [ + "CREATE_EXCHANGE_WITHDRAWAL", + "MAKE_EXCHANGE_WITHDRAWAL", + "SUBMIT_EXCHANGE_WITHDRAWAL", + "START_EXCHANGE_WITHDRAWAL", + "OPEN_EXCHANGE_WITHDRAWAL", + "SET_EXCHANGE_WITHDRAWAL", + "PROCESS_EXCHANGE_WITHDRAWAL", + "INITIALIZE_EXCHANGE_WITHDRAWAL", + "BEGIN_EXCHANGE_WITHDRAWAL", +]; + +// Position Management Actions +export const msgIncreasePositionMarginSimiles = [ + "INCREASE_POSITION_MARGIN", + "ADD_POSITION_MARGIN", + "RAISE_POSITION_MARGIN", + "BOOST_POSITION_MARGIN", + "EXPAND_POSITION_MARGIN", + "EXTEND_POSITION_MARGIN", + "ENHANCE_POSITION_MARGIN", + "GROW_POSITION_MARGIN", + "LIFT_POSITION_MARGIN", +]; + +export const msgLiquidatePositionSimiles = [ + "LIQUIDATE_EXCHANGE_POSITION", + "END_EXCHANGE_POSITION", + "TERMINATE_EXCHANGE_POSITION", + "FINISH_EXCHANGE_POSITION", + "CLEAR_EXCHANGE_POSITION", + "COMPLETE_EXCHANGE_POSITION", + "RESOLVE_EXCHANGE_POSITION", + "SETTLE_EXCHANGE_POSITION", +]; + +// Administrative Actions +export const msgInstantSpotMarketLaunchSimiles = [ + "LAUNCH_SPOT_MARKET", + "START_SPOT_MARKET", + "CREATE_SPOT_MARKET", + "OPEN_SPOT_MARKET", + "INITIALIZE_SPOT_MARKET", + "BEGIN_SPOT_MARKET", + "DEPLOY_SPOT_MARKET", + "ESTABLISH_SPOT_MARKET", + "ACTIVATE_SPOT_MARKET", +]; + +export const msgReclaimLockedFundsSimiles = [ + "RECLAIM_LOCKED_FUNDS", + "RECOVER_LOCKED_FUNDS", + "RETRIEVE_LOCKED_FUNDS", + "RELEASE_LOCKED_FUNDS", + "RESTORE_LOCKED_FUNDS", + "RETURN_LOCKED_FUNDS", + "UNLOCK_LOCKED_FUNDS", + "FREE_LOCKED_FUNDS", + "COLLECT_LOCKED_FUNDS", +]; + +export const msgRewardsOptOutSimiles = [ + "DISABLE_EXCHANGE_REWARDS", + "STOP_EXCHANGE_REWARDS", + "EXIT_EXCHANGE_REWARDS", + "LEAVE_EXCHANGE_REWARDS", + "QUIT_EXCHANGE_REWARDS", + "END_EXCHANGE_REWARDS", + "WITHDRAW_EXCHANGE_REWARDS", + "ABANDON_EXCHANGE_REWARDS", + "DECLINE_EXCHANGE_REWARDS", +]; + +export const msgSignDataSimiles = [ + "SIGN_EXCHANGE_DATA", + "AUTHORIZE_EXCHANGE_DATA", + "APPROVE_EXCHANGE_DATA", + "VALIDATE_EXCHANGE_DATA", + "CONFIRM_EXCHANGE_DATA", + "VERIFY_EXCHANGE_DATA", + "ENDORSE_EXCHANGE_DATA", + "CERTIFY_EXCHANGE_DATA", + "AUTHENTICATE_EXCHANGE_DATA", +]; + +export const msgExternalTransferSimiles = [ + "CREATE_EXTERNAL_TRANSFER", + "MAKE_EXTERNAL_TRANSFER", + "SUBMIT_EXTERNAL_TRANSFER", + "START_EXTERNAL_TRANSFER", + "PROCESS_EXTERNAL_TRANSFER", + "INITIATE_EXTERNAL_TRANSFER", + "BEGIN_EXTERNAL_TRANSFER", + "EXECUTE_EXTERNAL_TRANSFER", + "PERFORM_EXTERNAL_TRANSFER", +]; + +export const msgAdminUpdateBinaryOptionsMarketSimiles = [ + "UPDATE_BINARY_OPTIONS", + "MODIFY_BINARY_OPTIONS", + "CHANGE_BINARY_OPTIONS", + "ADJUST_BINARY_OPTIONS", + "EDIT_BINARY_OPTIONS", + "REVISE_BINARY_OPTIONS", + "ALTER_BINARY_OPTIONS", + "AMEND_BINARY_OPTIONS", + "CONFIGURE_BINARY_OPTIONS", +]; +export const getRewardsSimiles = [ + "VIEW_EXCHANGE_REWARDS", + "GET_EXCHANGE_REWARDS", + "CHECK_EXCHANGE_REWARDS", + "FETCH_EXCHANGE_REWARDS", + "READ_EXCHANGE_REWARDS", + "DISPLAY_EXCHANGE_REWARDS", + "SHOW_EXCHANGE_REWARDS", + "LIST_EXCHANGE_REWARDS", + "RETRIEVE_EXCHANGE_REWARDS", +]; + +export const getAtomicSwapHistorySimiles = [ + "VIEW_ATOMIC_SWAPS", + "GET_ATOMIC_SWAPS", + "CHECK_ATOMIC_SWAPS", + "FETCH_ATOMIC_SWAPS", + "READ_ATOMIC_SWAPS", + "DISPLAY_ATOMIC_SWAPS", + "SHOW_ATOMIC_SWAPS", + "LIST_ATOMIC_SWAPS", + "RETRIEVE_ATOMIC_SWAPS", +]; + +export const getGridStrategiesSimiles = [ + "VIEW_GRID_STRATEGIES", + "GET_GRID_STRATEGIES", + "CHECK_GRID_STRATEGIES", + "FETCH_GRID_STRATEGIES", + "READ_GRID_STRATEGIES", + "DISPLAY_GRID_STRATEGIES", + "SHOW_GRID_STRATEGIES", + "LIST_GRID_STRATEGIES", + "RETRIEVE_GRID_STRATEGIES", +]; + +export const getHistoricalVolumesSimiles = [ + "VIEW_HISTORICAL_VOLUMES", + "GET_HISTORICAL_VOLUMES", + "CHECK_HISTORICAL_VOLUMES", + "FETCH_HISTORICAL_VOLUMES", + "READ_HISTORICAL_VOLUMES", + "DISPLAY_HISTORICAL_VOLUMES", + "SHOW_HISTORICAL_VOLUMES", + "LIST_HISTORICAL_VOLUMES", + "RETRIEVE_HISTORICAL_VOLUMES", +]; + +export const getPnlLeaderboardFixedResolutionSimiles = [ + "VIEW_FIXED_RESOLUTION_LEADERBOARD", + "GET_FIXED_RESOLUTION_LEADERBOARD", + "CHECK_FIXED_RESOLUTION_LEADERBOARD", + "FETCH_FIXED_RESOLUTION_LEADERBOARD", + "READ_FIXED_RESOLUTION_LEADERBOARD", + "DISPLAY_FIXED_RESOLUTION_LEADERBOARD", + "SHOW_FIXED_RESOLUTION_LEADERBOARD", + "LIST_FIXED_RESOLUTION_LEADERBOARD", + "RETRIEVE_FIXED_RESOLUTION_LEADERBOARD", +]; + +export const getVolLeaderboardFixedResolutionSimiles = [ + "VIEW_VOLUME_FIXED", + "GET_VOLUME_FIXED", + "CHECK_VOLUME_FIXED", + "FETCH_VOLUME_FIXED", + "READ_VOLUME_FIXED", + "DISPLAY_VOLUME_FIXED", + "SHOW_VOLUME_FIXED", + "LIST_VOLUME_FIXED", + "RETRIEVE_VOLUME_FIXED", +]; + +export const getDenomHoldersSimiles = [ + "VIEW_DENOM_HOLDERS", + "GET_DENOM_HOLDERS", + "CHECK_DENOM_HOLDERS", + "FETCH_DENOM_HOLDERS", + "READ_DENOM_HOLDERS", + "DISPLAY_DENOM_HOLDERS", + "SHOW_DENOM_HOLDERS", + "LIST_DENOM_HOLDERS", + "RETRIEVE_DENOM_HOLDERS", +]; + +export const msgBatchUpdateOrdersSimiles = [ + "UPDATE_ORDER_BATCH", + "MODIFY_ORDER_BATCH", + "CHANGE_ORDER_BATCH", + "ADJUST_ORDER_BATCH", + "EDIT_ORDER_BATCH", + "REVISE_ORDER_BATCH", + "ALTER_ORDER_BATCH", + "AMEND_ORDER_BATCH", + "CONFIGURE_ORDER_BATCH", +]; + +export const msgCancelBinaryOptionsOrderSimiles = [ + "CANCEL_BINARY_OPTIONS_ORDER", + "REMOVE_BINARY_OPTIONS_ORDER", + "DELETE_BINARY_OPTIONS_ORDER", + "STOP_BINARY_OPTIONS_ORDER", + "END_BINARY_OPTIONS_ORDER", + "CLEAR_BINARY_OPTIONS_ORDER", + "TERMINATE_BINARY_OPTIONS_ORDER", + "HALT_BINARY_OPTIONS_ORDER", + "CLOSE_BINARY_OPTIONS_ORDER", +]; + +export const msgCancelDerivativeOrderSimiles = [ + "CANCEL_DERIVATIVE_ORDER", + "REMOVE_DERIVATIVE_ORDER", + "DELETE_DERIVATIVE_ORDER", + "STOP_DERIVATIVE_ORDER", + "END_DERIVATIVE_ORDER", + "CLEAR_DERIVATIVE_ORDER", + "TERMINATE_DERIVATIVE_ORDER", + "HALT_DERIVATIVE_ORDER", + "CLOSE_DERIVATIVE_ORDER", +]; + +export const msgCancelSpotOrderSimiles = [ + "CANCEL_SPOT_ORDER", + "REMOVE_SPOT_ORDER", + "DELETE_SPOT_ORDER", + "STOP_SPOT_ORDER", + "END_SPOT_ORDER", + "CLEAR_SPOT_ORDER", + "TERMINATE_SPOT_ORDER", + "HALT_SPOT_ORDER", + "CLOSE_SPOT_ORDER", +]; diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/similes/explorer.ts b/packages/plugin-injective/injective-sdk-client-ts/src/similes/explorer.ts new file mode 100644 index 00000000000..c1b8b4d3a95 --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/similes/explorer.ts @@ -0,0 +1,131 @@ +export const getTxByHashSimiles = [ + "VIEW_TRANSACTION_BY_HASH_BY_HASH", + "GET_TRANSACTION_BY_HASH", + "CHECK_TRANSACTION_BY_HASH", + "FETCH_TRANSACTION_BY_HASH", + "READ_TRANSACTION_BY_HASH", + "DISPLAY_TRANSACTION_BY_HASH", + "SHOW_TRANSACTION_BY_HASH", + "LIST_TRANSACTION_BY_HASH", + "RETRIEVE_TRANSACTION_BY_HASH", +]; + +export const getAccountTxSimiles = [ + "VIEW_ACCOUNT_TRANSACTIONS", + "GET_ACCOUNT_TRANSACTIONS", + "CHECK_ACCOUNT_TRANSACTIONS", + "FETCH_ACCOUNT_TRANSACTIONS", + "READ_ACCOUNT_TRANSACTIONS", + "DISPLAY_ACCOUNT_TRANSACTIONS", + "SHOW_ACCOUNT_TRANSACTIONS", + "LIST_ACCOUNT_TRANSACTIONS", + "RETRIEVE_ACCOUNT_TRANSACTIONS", +]; + +export const getExplorerValidatorSimiles = [ + "VIEW_EXPLORER_EXPLORER_VALIDATOR", + "GET_EXPLORER_EXPLORER_VALIDATOR", + "CHECK_EXPLORER_VALIDATOR", + "FETCH_EXPLORER_VALIDATOR", + "READ_EXPLORER_VALIDATOR", + "DISPLAY_EXPLORER_VALIDATOR", + "SHOW_EXPLORER_VALIDATOR", + "LIST_EXPLORER_VALIDATOR", + "RETRIEVE_EXPLORER_VALIDATOR", +]; + +export const getExplorerValidatorUptimeSimiles = [ + "VIEW_EXPLORER_VALIDATOR_UPTIME", + "GET_EXPLORER_VALIDATOR_UPTIME", + "CHECK_EXPLORER_VALIDATOR_UPTIME", + "FETCH_EXPLORER_VALIDATOR_UPTIME", + "READ_EXPLORER_VALIDATOR_UPTIME", + "DISPLAY_EXPLORER_VALIDATOR_UPTIME", + "SHOW_EXPLORER_VALIDATOR_UPTIME", + "LIST_EXPLORER_VALIDATOR_UPTIME", + "RETRIEVE_EXPLORER_VALIDATOR_UPTIME", +]; + +export const getPeggyDepositTxsSimiles = [ + "VIEW_PEGGY_DEPOSITS", + "GET_PEGGY_DEPOSITS", + "CHECK_PEGGY_DEPOSITS", + "FETCH_PEGGY_DEPOSITS", + "READ_PEGGY_DEPOSITS", + "DISPLAY_PEGGY_DEPOSITS", + "SHOW_PEGGY_DEPOSITS", + "LIST_PEGGY_DEPOSITS", + "RETRIEVE_PEGGY_DEPOSITS", +]; + +export const getPeggyWithdrawalTxsSimiles = [ + "VIEW_PEGGY_WITHDRAWALS", + "GET_PEGGY_WITHDRAWALS", + "CHECK_PEGGY_WITHDRAWALS", + "FETCH_PEGGY_WITHDRAWALS", + "READ_PEGGY_WITHDRAWALS", + "DISPLAY_PEGGY_WITHDRAWALS", + "SHOW_PEGGY_WITHDRAWALS", + "LIST_PEGGY_WITHDRAWALS", + "RETRIEVE_PEGGY_WITHDRAWALS", +]; + +export const getBlocksSimiles = [ + "VIEW_BLOCKS", + "GET_BLOCKS", + "CHECK_BLOCKS", + "FETCH_BLOCKS", + "READ_BLOCKS", + "DISPLAY_BLOCKS", + "SHOW_BLOCKS", + "LIST_BLOCKS", + "RETRIEVE_BLOCKS", +]; + +export const getBlockSimiles = [ + "VIEW_BLOCK", + "GET_BLOCK", + "CHECK_BLOCK", + "FETCH_BLOCK", + "READ_BLOCK", + "DISPLAY_BLOCK", + "SHOW_BLOCK", + "LIST_BLOCK", + "RETRIEVE_BLOCK", +]; + +export const getTxsSimiles = [ + "VIEW_TRANSACTIONS", + "GET_TRANSACTIONS", + "CHECK_TRANSACTIONS", + "FETCH_TRANSACTIONS", + "READ_TRANSACTIONS", + "DISPLAY_TRANSACTIONS", + "SHOW_TRANSACTIONS", + "LIST_TRANSACTIONS", + "RETRIEVE_TRANSACTIONS", +]; + +export const getIBCTransferTxsSimiles = [ + "VIEW_IBC_TRANSFERS", + "GET_IBC_TRANSFERS", + "CHECK_IBC_TRANSFERS", + "FETCH_IBC_TRANSFERS", + "READ_IBC_TRANSFERS", + "DISPLAY_IBC_TRANSFERS", + "SHOW_IBC_TRANSFERS", + "LIST_IBC_TRANSFERS", + "RETRIEVE_IBC_TRANSFERS", +]; + +export const getExplorerStatsSimiles = [ + "VIEW_EXPLORER_STATS", + "GET_EXPLORER_STATS", + "CHECK_EXPLORER_STATS", + "FETCH_EXPLORER_STATS", + "READ_EXPLORER_STATS", + "DISPLAY_EXPLORER_STATS", + "SHOW_EXPLORER_STATS", + "LIST_EXPLORER_STATS", + "RETRIEVE_EXPLORER_STATS", +]; diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/similes/gov.ts b/packages/plugin-injective/injective-sdk-client-ts/src/similes/gov.ts new file mode 100644 index 00000000000..0550865a444 --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/similes/gov.ts @@ -0,0 +1,167 @@ +export const getGovernanceModuleParamsSimiles = [ + "VIEW_GOVERNANCE_PARAMS", + "GET_GOVERNANCE_PARAMS", + "CHECK_GOVERNANCE_PARAMS", + "FETCH_GOVERNANCE_PARAMS", + "READ_GOVERNANCE_PARAMS", + "DISPLAY_GOVERNANCE_PARAMS", + "SHOW_GOVERNANCE_PARAMS", + "LIST_GOVERNANCE_PARAMS", + "RETRIEVE_GOVERNANCE_PARAMS", +]; + +export const getProposalsSimiles = [ + "VIEW_PROPOSALS", + "GET_PROPOSALS", + "CHECK_PROPOSALS", + "FETCH_PROPOSALS", + "READ_PROPOSALS", + "DISPLAY_PROPOSALS", + "SHOW_PROPOSALS", + "LIST_PROPOSALS", + "RETRIEVE_PROPOSALS", +]; + +export const getProposalSimiles = [ + "VIEW_PROPOSAL", + "GET_PROPOSAL", + "CHECK_PROPOSAL", + "FETCH_PROPOSAL", + "READ_PROPOSAL", + "DISPLAY_PROPOSAL", + "SHOW_PROPOSAL", + "LIST_PROPOSAL", + "RETRIEVE_PROPOSAL", +]; + +export const getProposalDepositsSimiles = [ + "VIEW_PROPOSAL_DEPOSITS", + "GET_PROPOSAL_DEPOSITS", + "CHECK_PROPOSAL_DEPOSITS", + "FETCH_PROPOSAL_DEPOSITS", + "READ_PROPOSAL_DEPOSITS", + "DISPLAY_PROPOSAL_DEPOSITS", + "SHOW_PROPOSAL_DEPOSITS", + "LIST_PROPOSAL_DEPOSITS", + "RETRIEVE_PROPOSAL_DEPOSITS", +]; + +export const getProposalVotesSimiles = [ + "VIEW_PROPOSAL_VOTES", + "GET_PROPOSAL_VOTES", + "CHECK_PROPOSAL_VOTES", + "FETCH_PROPOSAL_VOTES", + "READ_PROPOSAL_VOTES", + "DISPLAY_PROPOSAL_VOTES", + "SHOW_PROPOSAL_VOTES", + "LIST_PROPOSAL_VOTES", + "RETRIEVE_PROPOSAL_VOTES", +]; + +export const getProposalTallySimiles = [ + "VIEW_PROPOSAL_TALLY", + "GET_PROPOSAL_TALLY", + "CHECK_PROPOSAL_TALLY", + "FETCH_PROPOSAL_TALLY", + "READ_PROPOSAL_TALLY", + "DISPLAY_PROPOSAL_TALLY", + "SHOW_PROPOSAL_TALLY", + "LIST_PROPOSAL_TALLY", + "RETRIEVE_PROPOSAL_TALLY", +]; + +export const msgSubmitProposalExpiryFuturesMarketLaunchSimiles = [ + "SUBMIT_EXPIRY_FUTURES_MARKET_PROPOSAL", + "CREATE_EXPIRY_FUTURES_MARKET_PROPOSAL", + "INITIALIZE_EXPIRY_FUTURES_MARKET_PROPOSAL", + "START_EXPIRY_FUTURES_MARKET_PROPOSAL", + "LAUNCH_EXPIRY_FUTURES_MARKET_PROPOSAL", + "PROPOSE_EXPIRY_FUTURES_MARKET_MARKET", + "BEGIN_EXPIRY_FUTURES_MARKET_PROPOSAL", + "ESTABLISH_EXPIRY_FUTURES_MARKET_PROPOSAL", + "SETUP_EXPIRY_FUTURES_MARKET_PROPOSAL", +]; + +export const msgSubmitProposalSpotMarketLaunchSimiles = [ + "SUBMIT_SPOT_MARKET_PROPOSAL", + "CREATE_SPOT_MARKET_PROPOSAL", + "INITIALIZE_SPOT_MARKET_PROPOSAL", + "START_SPOT_MARKET_PROPOSAL", + "LAUNCH_SPOT_MARKET_PROPOSAL", + "PROPOSE_SPOT_MARKET", + "BEGIN_SPOT_MARKET_PROPOSAL", + "ESTABLISH_SPOT_MARKET_PROPOSAL", + "SETUP_SPOT_MARKET_PROPOSAL", +]; + +export const msgSubmitProposalPerpetualMarketLaunchSimiles = [ + "SUBMIT_PERPETUAL_MARKET_PROPOSAL", + "CREATE_PERPETUAL_MARKET_PROPOSAL", + "INITIALIZE_PERPETUAL_MARKET_PROPOSAL", + "START_PERPETUAL_MARKET_PROPOSAL", + "LAUNCH_PERPETUAL_MARKET_PROPOSAL", + "PROPOSE_PERPETUAL_MARKET", + "BEGIN_PERPETUAL_MARKET_PROPOSAL", + "ESTABLISH_PERPETUAL_MARKET_PROPOSAL", + "SETUP_PERPETUAL_MARKET_PROPOSAL", +]; + +export const msgVoteSimiles = [ + "SUBMIT_VOTE", + "CAST_VOTE", + "REGISTER_VOTE", + "RECORD_VOTE", + "ENTER_VOTE", + "PLACE_VOTE", + "LOG_VOTE", + "SEND_VOTE", + "MAKE_VOTE", +]; + +export const msgSubmitTextProposalSimiles = [ + "SUBMIT_TEXT_PROPOSAL", + "CREATE_TEXT_PROPOSAL", + "INITIALIZE_TEXT_PROPOSAL", + "START_TEXT_PROPOSAL", + "LAUNCH_TEXT_PROPOSAL", + "PROPOSE_TEXT_CHANGE", + "BEGIN_TEXT_PROPOSAL", + "ESTABLISH_TEXT_PROPOSAL", + "SETUP_TEXT_PROPOSAL", +]; + +export const msgSubmitProposalSpotMarketParamUpdateSimiles = [ + "SUBMIT_SPOT_MARKET_PARAM_UPDATE", + "CREATE_SPOT_MARKET_PARAM_UPDATE", + "INITIALIZE_SPOT_MARKET_PARAM_UPDATE", + "START_SPOT_MARKET_PARAM_UPDATE", + "LAUNCH_SPOT_MARKET_PARAM_UPDATE", + "PROPOSE_SPOT_MARKET_PARAM_CHANGE", + "BEGIN_SPOT_MARKET_PARAM_UPDATE", + "ESTABLISH_SPOT_MARKET_PARAM_UPDATE", + "SETUP_SPOT_MARKET_PARAM_UPDATE", +]; + +export const msgSubmitGenericProposalSimiles = [ + "SUBMIT_GENERIC_PROPOSAL", + "CREATE_GENERIC_PROPOSAL", + "INITIALIZE_GENERIC_PROPOSAL", + "START_GENERIC_PROPOSAL", + "LAUNCH_GENERIC_PROPOSAL", + "PROPOSE_GENERIC_CHANGE", + "BEGIN_GENERIC_PROPOSAL", + "ESTABLISH_GENERIC_PROPOSAL", + "SETUP_GENERIC_PROPOSAL", +]; + +export const msgGovDepositSimiles = [ + "SUBMIT_PROPOSAL_DEPOSIT", + "ADD_PROPOSAL_DEPOSIT", + "MAKE_PROPOSAL_DEPOSIT", + "SEND_PROPOSAL_DEPOSIT", + "PLACE_PROPOSAL_DEPOSIT", + "TRANSFER_PROPOSAL_DEPOSIT", + "DEPOSIT_TO_PROPOSAL", + "FUND_PROPOSAL", + "CONTRIBUTE_TO_PROPOSAL", +]; diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/similes/ibc.ts b/packages/plugin-injective/injective-sdk-client-ts/src/similes/ibc.ts new file mode 100644 index 00000000000..1fba527763b --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/similes/ibc.ts @@ -0,0 +1,35 @@ +export const getDenomTraceSimiles = [ + "VIEW_DENOM_TRACE", + "GET_DENOM_TRACE", + "CHECK_DENOM_TRACE", + "FETCH_DENOM_TRACE", + "READ_DENOM_TRACE", + "DISPLAY_DENOM_TRACE", + "SHOW_DENOM_TRACE", + "LIST_DENOM_TRACE", + "RETRIEVE_DENOM_TRACE", +]; + +export const getDenomsTraceSimiles = [ + "VIEW_DENOM_TRACES", + "GET_DENOM_TRACES", + "CHECK_DENOM_TRACES", + "FETCH_DENOM_TRACES", + "READ_DENOM_TRACES", + "DISPLAY_DENOM_TRACES", + "SHOW_DENOM_TRACES", + "LIST_DENOM_TRACES", + "RETRIEVE_DENOM_TRACES", +]; + +export const msgIBCTransferSimiles = [ + "SUBMIT_IBC_TRANSFER", + "EXECUTE_IBC_TRANSFER", + "PERFORM_IBC_TRANSFER", + "SEND_IBC_TOKENS", + "TRANSFER_IBC_TOKENS", + "INITIATE_IBC_TRANSFER", + "START_IBC_TRANSFER", + "CREATE_IBC_TRANSFER", + "PROCESS_IBC_TRANSFER", +]; diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/similes/insurance.ts b/packages/plugin-injective/injective-sdk-client-ts/src/similes/insurance.ts new file mode 100644 index 00000000000..2f2ac0c8090 --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/similes/insurance.ts @@ -0,0 +1,95 @@ +export const getInsuranceModuleParamsSimiles = [ + "VIEW_INSURANCE_MODULE_PARAMS", + "GET_INSURANCE_MODULE_PARAMS", + "CHECK_INSURANCE_MODULE_PARAMS", + "FETCH_INSURANCE_MODULE_PARAMS", + "READ_INSURANCE_MODULE_PARAMS", + "DISPLAY_INSURANCE_MODULE_PARAMS", + "SHOW_INSURANCE_MODULE_PARAMS", + "LIST_INSURANCE_MODULE_PARAMS", + "RETRIEVE_INSURANCE_MODULE_PARAMS", +]; + +export const getInsuranceFundsSimiles = [ + "VIEW_INSURANCE_FUNDS", + "GET_INSURANCE_FUNDS", + "CHECK_INSURANCE_FUNDS", + "FETCH_INSURANCE_FUNDS", + "READ_INSURANCE_FUNDS", + "DISPLAY_INSURANCE_FUNDS", + "SHOW_INSURANCE_FUNDS", + "LIST_INSURANCE_FUNDS", + "RETRIEVE_INSURANCE_FUNDS", +]; + +export const getInsuranceFundSimiles = [ + "VIEW_INSURANCE_FUND", + "GET_INSURANCE_FUND", + "CHECK_INSURANCE_FUND", + "FETCH_INSURANCE_FUND", + "READ_INSURANCE_FUND", + "DISPLAY_INSURANCE_FUND", + "SHOW_INSURANCE_FUND", + "LIST_INSURANCE_FUND", + "RETRIEVE_INSURANCE_FUND", +]; + +export const getEstimatedRedemptionsSimiles = [ + "VIEW_ESTIMATED_REDEMPTIONS", + "GET_ESTIMATED_REDEMPTIONS", + "CHECK_ESTIMATED_REDEMPTIONS", + "FETCH_ESTIMATED_REDEMPTIONS", + "READ_ESTIMATED_REDEMPTIONS", + "DISPLAY_ESTIMATED_REDEMPTIONS", + "SHOW_ESTIMATED_REDEMPTIONS", + "LIST_ESTIMATED_REDEMPTIONS", + "RETRIEVE_ESTIMATED_REDEMPTIONS", +]; + +export const getPendingRedemptionsSimiles = [ + "VIEW_PENDING_REDEMPTIONS", + "GET_PENDING_REDEMPTIONS", + "CHECK_PENDING_REDEMPTIONS", + "FETCH_PENDING_REDEMPTIONS", + "READ_PENDING_REDEMPTIONS", + "DISPLAY_PENDING_REDEMPTIONS", + "SHOW_PENDING_REDEMPTIONS", + "LIST_PENDING_REDEMPTIONS", + "RETRIEVE_PENDING_REDEMPTIONS", +]; + +export const msgCreateInsuranceFundSimiles = [ + "CREATE_INSURANCE_FUND", + "ESTABLISH_INSURANCE_FUND", + "SETUP_INSURANCE_FUND", + "INITIALIZE_INSURANCE_FUND", + "START_INSURANCE_FUND", + "LAUNCH_INSURANCE_FUND", + "OPEN_INSURANCE_FUND", + "BEGIN_INSURANCE_FUND", + "INSTITUTE_INSURANCE_FUND", +]; + +export const msgRequestRedemptionSimiles = [ + "REQUEST_REDEMPTION", + "INITIATE_REDEMPTION", + "SUBMIT_REDEMPTION", + "START_REDEMPTION", + "PROCESS_REDEMPTION", + "CREATE_REDEMPTION", + "EXECUTE_REDEMPTION", + "BEGIN_REDEMPTION", + "PERFORM_REDEMPTION", +]; + +export const msgUnderwriteSimiles = [ + "UNDERWRITE_INSURANCE", + "BACK_INSURANCE", + "SUPPORT_INSURANCE", + "GUARANTEE_INSURANCE", + "SECURE_INSURANCE", + "SPONSOR_INSURANCE", + "FUND_INSURANCE", + "FINANCE_INSURANCE", + "PROVIDE_INSURANCE_BACKING", +]; diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/similes/mint.ts b/packages/plugin-injective/injective-sdk-client-ts/src/similes/mint.ts new file mode 100644 index 00000000000..d5f12887b35 --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/similes/mint.ts @@ -0,0 +1,35 @@ +export const getMintModuleParamsSimiles = [ + "VIEW_MINT_MODULE_PARAMS", + "GET_MINT_MODULE_PARAMS", + "CHECK_MINT_MODULE_PARAMS", + "FETCH_MINT_MODULE_PARAMS", + "READ_MINT_MODULE_PARAMS", + "DISPLAY_MINT_MODULE_PARAMS", + "SHOW_MINT_MODULE_PARAMS", + "LIST_MINT_MODULE_PARAMS", + "RETRIEVE_MINT_MODULE_PARAMS", +]; + +export const getInflationSimiles = [ + "VIEW_INFLATION_RATE", + "GET_INFLATION_RATE", + "CHECK_INFLATION_RATE", + "FETCH_INFLATION_RATE", + "READ_INFLATION_RATE", + "DISPLAY_INFLATION_RATE", + "SHOW_INFLATION_RATE", + "LIST_INFLATION_RATE", + "RETRIEVE_INFLATION_RATE", +]; + +export const getAnnualProvisionsSimiles = [ + "VIEW_ANNUAL_PROVISIONS", + "GET_ANNUAL_PROVISIONS", + "CHECK_ANNUAL_PROVISIONS", + "FETCH_ANNUAL_PROVISIONS", + "READ_ANNUAL_PROVISIONS", + "DISPLAY_ANNUAL_PROVISIONS", + "SHOW_ANNUAL_PROVISIONS", + "LIST_ANNUAL_PROVISIONS", + "RETRIEVE_ANNUAL_PROVISIONS", +]; diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/similes/mito.ts b/packages/plugin-injective/injective-sdk-client-ts/src/similes/mito.ts new file mode 100644 index 00000000000..6f039389f89 --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/similes/mito.ts @@ -0,0 +1,364 @@ +// Vault Related Similes +export const getVaultSimiles = [ + "VIEW_VAULT", + "GET_VAULT", + "CHECK_VAULT", + "FETCH_VAULT", + "READ_VAULT", + "DISPLAY_VAULT", + "SHOW_VAULT", + "LIST_VAULT", + "RETRIEVE_VAULT", +]; + +export const getVaultsSimiles = [ + "VIEW_VAULTS", + "GET_VAULTS", + "CHECK_VAULTS", + "FETCH_VAULTS", + "READ_VAULTS", + "DISPLAY_VAULTS", + "SHOW_VAULTS", + "LIST_VAULTS", + "RETRIEVE_VAULTS", +]; + +export const getVaultsByHolderAddressSimiles = [ + "VIEW_HOLDER_VAULTS", + "GET_HOLDER_VAULTS", + "CHECK_HOLDER_VAULTS", + "FETCH_HOLDER_VAULTS", + "READ_HOLDER_VAULTS", + "DISPLAY_HOLDER_VAULTS", + "SHOW_HOLDER_VAULTS", + "LIST_HOLDER_VAULTS", + "RETRIEVE_HOLDER_VAULTS", +]; + +// LP Token Related Similes +export const getLpTokenPriceChartSimiles = [ + "VIEW_LP_PRICE_CHART", + "GET_LP_PRICE_CHART", + "CHECK_LP_PRICE_CHART", + "FETCH_LP_PRICE_CHART", + "READ_LP_PRICE_CHART", + "DISPLAY_LP_PRICE_CHART", + "SHOW_LP_PRICE_CHART", + "LIST_LP_PRICE_CHART", + "RETRIEVE_LP_PRICE_CHART", +]; + +export const getLPHoldersSimiles = [ + "VIEW_LP_HOLDERS", + "GET_LP_HOLDERS", + "CHECK_LP_HOLDERS", + "FETCH_LP_HOLDERS", + "READ_LP_HOLDERS", + "DISPLAY_LP_HOLDERS", + "SHOW_LP_HOLDERS", + "LIST_LP_HOLDERS", + "RETRIEVE_LP_HOLDERS", +]; + +// TVL and Portfolio Related Similes +export const getTVLChartSimiles = [ + "VIEW_TVL_CHART", + "GET_TVL_CHART", + "CHECK_TVL_CHART", + "FETCH_TVL_CHART", + "READ_TVL_CHART", + "DISPLAY_TVL_CHART", + "SHOW_TVL_CHART", + "LIST_TVL_CHART", + "RETRIEVE_TVL_CHART", +]; + +export const getHolderPortfolioSimiles = [ + "VIEW_HOLDER_PORTFOLIO", + "GET_HOLDER_PORTFOLIO", + "CHECK_HOLDER_PORTFOLIO", + "FETCH_HOLDER_PORTFOLIO", + "READ_HOLDER_PORTFOLIO", + "DISPLAY_HOLDER_PORTFOLIO", + "SHOW_HOLDER_PORTFOLIO", + "LIST_HOLDER_PORTFOLIO", + "RETRIEVE_HOLDER_PORTFOLIO", +]; + +// MITO_LEADERBOARD Related Similes +export const getLeaderboardSimiles = [ + "VIEW_MITO_LEADERBOARD", + "GET_MITO_LEADERBOARD", + "CHECK_MITO_LEADERBOARD", + "FETCH_MITO_LEADERBOARD", + "READ_MITO_LEADERBOARD", + "DISPLAY_MITO_LEADERBOARD", + "SHOW_MITO_LEADERBOARD", + "LIST_MITO_LEADERBOARD", + "RETRIEVE_MITO_LEADERBOARD", +]; + +export const getLeaderboardEpochsSimiles = [ + "VIEW_MITO_LEADERBOARD_EPOCHS", + "GET_MITO_LEADERBOARD_EPOCHS", + "CHECK_MITO_LEADERBOARD_EPOCHS", + "FETCH_MITO_LEADERBOARD_EPOCHS", + "READ_MITO_LEADERBOARD_EPOCHS", + "DISPLAY_MITO_LEADERBOARD_EPOCHS", + "SHOW_MITO_LEADERBOARD_EPOCHS", + "LIST_MITO_LEADERBOARD_EPOCHS", + "RETRIEVE_MITO_LEADERBOARD_EPOCHS", +]; + +// Transfer Related Similes +export const getTransferHistorySimiles = [ + "VIEW_TRANSFER_HISTORY", + "GET_TRANSFER_HISTORY", + "CHECK_TRANSFER_HISTORY", + "FETCH_TRANSFER_HISTORY", + "READ_TRANSFER_HISTORY", + "DISPLAY_TRANSFER_HISTORY", + "SHOW_TRANSFER_HISTORY", + "LIST_TRANSFER_HISTORY", + "RETRIEVE_TRANSFER_HISTORY", +]; + +// Staking Related Similes +export const getStakingPoolsSimiles = [ + "VIEW_STAKING_POOLS", + "GET_STAKING_POOLS", + "CHECK_STAKING_POOLS", + "FETCH_STAKING_POOLS", + "READ_STAKING_POOLS", + "DISPLAY_STAKING_POOLS", + "SHOW_STAKING_POOLS", + "LIST_STAKING_POOLS", + "RETRIEVE_STAKING_POOLS", +]; + +export const getStakingHistorySimiles = [ + "VIEW_STAKING_HISTORY", + "GET_STAKING_HISTORY", + "CHECK_STAKING_HISTORY", + "FETCH_STAKING_HISTORY", + "READ_STAKING_HISTORY", + "DISPLAY_STAKING_HISTORY", + "SHOW_STAKING_HISTORY", + "LIST_STAKING_HISTORY", + "RETRIEVE_STAKING_HISTORY", +]; + +export const getStakingRewardsByAccountSimiles = [ + "VIEW_STAKING_REWARDS", + "GET_STAKING_REWARDS", + "CHECK_STAKING_REWARDS", + "FETCH_STAKING_REWARDS", + "READ_STAKING_REWARDS", + "DISPLAY_STAKING_REWARDS", + "SHOW_STAKING_REWARDS", + "LIST_STAKING_REWARDS", + "RETRIEVE_STAKING_REWARDS", +]; + +// Mission Related Similes +export const getMissionsSimiles = [ + "VIEW_MISSIONS", + "GET_MISSIONS", + "CHECK_MISSIONS", + "FETCH_MISSIONS", + "READ_MISSIONS", + "DISPLAY_MISSIONS", + "SHOW_MISSIONS", + "LIST_MISSIONS", + "RETRIEVE_MISSIONS", +]; + +export const getMissionLeaderboardSimiles = [ + "VIEW_MISSION_MITO_LEADERBOARD", + "GET_MISSION_MITO_LEADERBOARD", + "CHECK_MISSION_MITO_LEADERBOARD", + "FETCH_MISSION_MITO_LEADERBOARD", + "READ_MISSION_MITO_LEADERBOARD", + "DISPLAY_MISSION_MITO_LEADERBOARD", + "SHOW_MISSION_MITO_LEADERBOARD", + "LIST_MISSION_MITO_LEADERBOARD", + "RETRIEVE_MISSION_MITO_LEADERBOARD", +]; + +// IDO Related Similes +export const getIDOSimiles = [ + "VIEW_IDO", + "GET_IDO", + "CHECK_IDO", + "FETCH_IDO", + "READ_IDO", + "DISPLAY_IDO", + "SHOW_IDO", + "LIST_IDO", + "RETRIEVE_IDO", +]; + +export const getIDOsSimiles = [ + "VIEW_IDOS", + "GET_IDOS", + "CHECK_IDOS", + "FETCH_IDOS", + "READ_IDOS", + "DISPLAY_IDOS", + "SHOW_IDOS", + "LIST_IDOS", + "RETRIEVE_IDOS", +]; + +export const getIDOSubscribersSimiles = [ + "VIEW_IDO_SUBSCRIBERS", + "GET_IDO_SUBSCRIBERS", + "CHECK_IDO_SUBSCRIBERS", + "FETCH_IDO_SUBSCRIBERS", + "READ_IDO_SUBSCRIBERS", + "DISPLAY_IDO_SUBSCRIBERS", + "SHOW_IDO_SUBSCRIBERS", + "LIST_IDO_SUBSCRIBERS", + "RETRIEVE_IDO_SUBSCRIBERS", +]; + +export const getIDOSubscriptionSimiles = [ + "VIEW_IDO_SUBSCRIPTION", + "GET_IDO_SUBSCRIPTION", + "CHECK_IDO_SUBSCRIPTION", + "FETCH_IDO_SUBSCRIPTION", + "READ_IDO_SUBSCRIPTION", + "DISPLAY_IDO_SUBSCRIPTION", + "SHOW_IDO_SUBSCRIPTION", + "LIST_IDO_SUBSCRIPTION", + "RETRIEVE_IDO_SUBSCRIPTION", +]; + +export const getIDOActivitiesSimiles = [ + "VIEW_IDO_ACTIVITIES", + "GET_IDO_ACTIVITIES", + "CHECK_IDO_ACTIVITIES", + "FETCH_IDO_ACTIVITIES", + "READ_IDO_ACTIVITIES", + "DISPLAY_IDO_ACTIVITIES", + "SHOW_IDO_ACTIVITIES", + "LIST_IDO_ACTIVITIES", + "RETRIEVE_IDO_ACTIVITIES", +]; + +export const getIDOWhitelistSimiles = [ + "VIEW_IDO_WHITELIST", + "GET_IDO_WHITELIST", + "CHECK_IDO_WHITELIST", + "FETCH_IDO_WHITELIST", + "READ_IDO_WHITELIST", + "DISPLAY_IDO_WHITELIST", + "SHOW_IDO_WHITELIST", + "LIST_IDO_WHITELIST", + "RETRIEVE_IDO_WHITELIST", +]; + +export const getClaimReferencesSimiles = [ + "VIEW_CLAIM_REFERENCES", + "GET_CLAIM_REFERENCES", + "CHECK_CLAIM_REFERENCES", + "FETCH_CLAIM_REFERENCES", + "READ_CLAIM_REFERENCES", + "DISPLAY_CLAIM_REFERENCES", + "SHOW_CLAIM_REFERENCES", + "LIST_CLAIM_REFERENCES", + "RETRIEVE_CLAIM_REFERENCES", +]; + +// Mito interactions + +// Launchpad Related Similes +export const getLaunchpadSubscribeSimiles = [ + "LAUNCHPAD_SUBSCRIBE", + "JOIN_LAUNCHPAD", + "ENTER_LAUNCHPAD", + "PARTICIPATE_LAUNCHPAD", + "REGISTER_LAUNCHPAD", + "ENROLL_LAUNCHPAD", + "ACCESS_LAUNCHPAD", + "ENGAGE_LAUNCHPAD", + "START_LAUNCHPAD", +]; + +export const getLaunchpadClaimSimiles = [ + "LAUNCHPAD_CLAIM", + "COLLECT_LAUNCHPAD", + "WITHDRAW_LAUNCHPAD", + "RETRIEVE_LAUNCHPAD", + "REDEEM_LAUNCHPAD", + "GATHER_LAUNCHPAD", + "OBTAIN_LAUNCHPAD", + "ACQUIRE_LAUNCHPAD", + "EXTRACT_LAUNCHPAD", +]; + +// Vault Related Action Similes +export const getSubscribeVaultSimiles = [ + "SUBSCRIBE_VAULT", + "JOIN_VAULT", + "ENTER_VAULT", + "PARTICIPATE_VAULT", + "REGISTER_VAULT", + "ENROLL_VAULT", + "ACCESS_VAULT", + "ENGAGE_VAULT", + "START_VAULT", +]; + +export const getInstantiateCPMMVaultSimiles = [ + "INSTANTIATE_CPMM_VAULT", + "CREATE_CPMM_VAULT", + "DEPLOY_CPMM_VAULT", + "LAUNCH_CPMM_VAULT", + "INITIALIZE_CPMM_VAULT", + "SETUP_CPMM_VAULT", + "START_CPMM_VAULT", + "BEGIN_CPMM_VAULT", + "ESTABLISH_CPMM_VAULT", +]; +export const getRedeemFromVaultSimiles = [ + "WITHDRAW_FROM_VAULT", + "EXIT_VAULT", + "REDEEM_FROM_VAULT", + "REMOVE_FROM_VAULT", + "LEAVE_VAULT", + "CASH_OUT_VAULT", + "EXTRACT_FROM_VAULT", + "PULL_FROM_VAULT", + "RECOVER_FROM_VAULT", +]; + +export const getStakeVaultLPSimiles = [ + "LOCK_VAULT_LP", + "STAKE_VAULT_LP", + "COMMIT_VAULT_LP", + "BOND_VAULT_LP", + "ALLOCATE_VAULT_LP", + "INVEST_VAULT_LP", + "HOLD_VAULT_LP", +]; + +export const getUnstakeVaultLPSimiles = [ + "UNLOCK_VAULT_LP", + "UNSTAKE_VAULT_LP", + "RELEASE_VAULT_LP", + "UNBOND_VAULT_LP", + "FREE_VAULT_LP", +]; + +export const getClaimVaultRewardsSimiles = [ + "COLLECT_VAULT_REWARDS", + "HARVEST_VAULT_REWARDS", + "CLAIM_VAULT_REWARDS", + "GATHER_VAULT_REWARDS", + "RECEIVE_VAULT_REWARDS", + "WITHDRAW_VAULT_REWARDS", + "GET_VAULT_REWARDS", + "FETCH_VAULT_REWARDS", + "REDEEM_VAULT_REWARDS", +]; diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/similes/peggy.ts b/packages/plugin-injective/injective-sdk-client-ts/src/similes/peggy.ts new file mode 100644 index 00000000000..bb846c2e6e8 --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/similes/peggy.ts @@ -0,0 +1,23 @@ +export const getPeggyModuleParamsSimiles = [ + "VIEW_PEGGY_BRIDGE_PARAMS", + "GET_PEGGY_BRIDGE_PARAMS", + "CHECK_PEGGY_BRIDGE_PARAMS", + "FETCH_PEGGY_BRIDGE_PARAMS", + "READ_PEGGY_BRIDGE_PARAMS", + "DISPLAY_PEGGY_BRIDGE_PARAMS", + "SHOW_PEGGY_BRIDGE_PARAMS", + "LIST_PEGGY_BRIDGE_PARAMS", + "RETRIEVE_PEGGY_BRIDGE_PARAMS", +]; + +export const msgSendToEthSimiles = [ + "SEND_TO_ETHEREUM", + "TRANSFER_TO_ETH", + "BRIDGE_TO_ETHEREUM", + "MOVE_TO_ETH", + "TRANSMIT_TO_ETHEREUM", + "FORWARD_TO_ETH", + "RELAY_TO_ETHEREUM", + "DISPATCH_TO_ETH", + "TRANSPORT_TO_ETHEREUM", +]; diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/similes/permissions.ts b/packages/plugin-injective/injective-sdk-client-ts/src/similes/permissions.ts new file mode 100644 index 00000000000..b19ace1efc3 --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/similes/permissions.ts @@ -0,0 +1,71 @@ +export const getAddressesByRoleSimiles = [ + "VIEW_ROLE_ADDRESSES", + "GET_ROLE_ADDRESSES", + "CHECK_ROLE_ADDRESSES", + "FETCH_ROLE_ADDRESSES", + "READ_ROLE_ADDRESSES", + "DISPLAY_ROLE_ADDRESSES", + "SHOW_ROLE_ADDRESSES", + "LIST_ROLE_ADDRESSES", + "RETRIEVE_ROLE_ADDRESSES", +]; + +export const getAddressRolesSimiles = [ + "VIEW_ADDRESS_ROLES", + "GET_ADDRESS_ROLES", + "CHECK_ADDRESS_ROLES", + "FETCH_ADDRESS_ROLES", + "READ_ADDRESS_ROLES", + "DISPLAY_ADDRESS_ROLES", + "SHOW_ADDRESS_ROLES", + "LIST_ADDRESS_ROLES", + "RETRIEVE_ADDRESS_ROLES", +]; + +export const getAllNamespacesSimiles = [ + "VIEW_NAMESPACES", + "GET_NAMESPACES", + "CHECK_NAMESPACES", + "FETCH_NAMESPACES", + "READ_NAMESPACES", + "DISPLAY_NAMESPACES", + "SHOW_NAMESPACES", + "LIST_NAMESPACES", + "RETRIEVE_NAMESPACES", +]; + +export const getPermissionsModuleParamsSimiles = [ + "VIEW_PERMISSIONS_PARAMS", + "GET_PERMISSIONS_PARAMS", + "CHECK_PERMISSIONS_PARAMS", + "FETCH_PERMISSIONS_PARAMS", + "READ_PERMISSIONS_PARAMS", + "DISPLAY_PERMISSIONS_PARAMS", + "SHOW_PERMISSIONS_PARAMS", + "LIST_PERMISSIONS_PARAMS", + "RETRIEVE_PERMISSIONS_PARAMS", +]; + +export const getNamespaceByDenomSimiles = [ + "VIEW_DENOM_NAMESPACE", + "GET_DENOM_NAMESPACE", + "CHECK_DENOM_NAMESPACE", + "FETCH_DENOM_NAMESPACE", + "READ_DENOM_NAMESPACE", + "DISPLAY_DENOM_NAMESPACE", + "SHOW_DENOM_NAMESPACE", + "LIST_DENOM_NAMESPACE", + "RETRIEVE_DENOM_NAMESPACE", +]; + +export const getVouchersForAddressSimiles = [ + "VIEW_ADDRESS_VOUCHERS", + "GET_ADDRESS_VOUCHERS", + "CHECK_ADDRESS_VOUCHERS", + "FETCH_ADDRESS_VOUCHERS", + "READ_ADDRESS_VOUCHERS", + "DISPLAY_ADDRESS_VOUCHERS", + "SHOW_ADDRESS_VOUCHERS", + "LIST_ADDRESS_VOUCHERS", + "RETRIEVE_ADDRESS_VOUCHERS", +]; diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/similes/staking.ts b/packages/plugin-injective/injective-sdk-client-ts/src/similes/staking.ts new file mode 100644 index 00000000000..a1acb0d55c8 --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/similes/staking.ts @@ -0,0 +1,279 @@ +// Module and Pool Query Actions +export const getStakingModuleParamsSimiles = [ + "VIEW_STAKING_PARAMS", + "GET_STAKING_PARAMS", + "CHECK_STAKING_PARAMS", + "FETCH_STAKING_PARAMS", + "READ_STAKING_PARAMS", + "DISPLAY_STAKING_PARAMS", + "SHOW_STAKING_PARAMS", + "LIST_STAKING_PARAMS", + "RETRIEVE_STAKING_PARAMS", +]; + +export const getPoolSimiles = [ + "VIEW_STAKING_POOL", + "GET_STAKING_POOL", + "CHECK_STAKING_POOL", + "FETCH_STAKING_POOL", + "READ_STAKING_POOL", + "DISPLAY_STAKING_POOL", + "SHOW_STAKING_POOL", + "LIST_STAKING_POOL", + "RETRIEVE_STAKING_POOL", +]; + +// Validator Query Actions +export const getValidatorsSimiles = [ + "VIEW_VALIDATORS", + "GET_VALIDATORS", + "CHECK_VALIDATORS", + "FETCH_VALIDATORS", + "READ_VALIDATORS", + "DISPLAY_VALIDATORS", + "SHOW_VALIDATORS", + "LIST_VALIDATORS", + "RETRIEVE_VALIDATORS", +]; + +export const getValidatorSimiles = [ + "VIEW_VALIDATOR", + "GET_VALIDATOR", + "CHECK_VALIDATOR", + "FETCH_VALIDATOR", + "READ_VALIDATOR", + "DISPLAY_VALIDATOR", + "SHOW_VALIDATOR", + "LIST_VALIDATOR", + "RETRIEVE_VALIDATOR", +]; + +// Delegation Query Actions +export const getValidatorDelegationsSimiles = [ + "VIEW_VALIDATOR_DELEGATIONS", + "GET_VALIDATOR_DELEGATIONS", + "CHECK_VALIDATOR_DELEGATIONS", + "FETCH_VALIDATOR_DELEGATIONS", + "READ_VALIDATOR_DELEGATIONS", + "DISPLAY_VALIDATOR_DELEGATIONS", + "SHOW_VALIDATOR_DELEGATIONS", + "LIST_VALIDATOR_DELEGATIONS", + "RETRIEVE_VALIDATOR_DELEGATIONS", +]; + +export const getValidatorDelegationsNoThrowSimiles = [ + "VIEW_VALIDATOR_DELEGATIONS_SAFE", + "GET_VALIDATOR_DELEGATIONS_SAFE", + "CHECK_VALIDATOR_DELEGATIONS_SAFE", + "FETCH_VALIDATOR_DELEGATIONS_SAFE", + "READ_VALIDATOR_DELEGATIONS_SAFE", + "DISPLAY_VALIDATOR_DELEGATIONS_SAFE", + "SHOW_VALIDATOR_DELEGATIONS_SAFE", + "LIST_VALIDATOR_DELEGATIONS_SAFE", + "RETRIEVE_VALIDATOR_DELEGATIONS_SAFE", +]; + +export const getValidatorUnbondingDelegationsSimiles = [ + "VIEW_VALIDATOR_UNBONDING", + "GET_VALIDATOR_UNBONDING", + "CHECK_VALIDATOR_UNBONDING", + "FETCH_VALIDATOR_UNBONDING", + "READ_VALIDATOR_UNBONDING", + "DISPLAY_VALIDATOR_UNBONDING", + "SHOW_VALIDATOR_UNBONDING", + "LIST_VALIDATOR_UNBONDING", + "RETRIEVE_VALIDATOR_UNBONDING", +]; + +export const getValidatorUnbondingDelegationsNoThrowSimiles = [ + "VIEW_VALIDATOR_UNBONDING_SAFE", + "GET_VALIDATOR_UNBONDING_SAFE", + "CHECK_VALIDATOR_UNBONDING_SAFE", + "FETCH_VALIDATOR_UNBONDING_SAFE", + "READ_VALIDATOR_UNBONDING_SAFE", + "DISPLAY_VALIDATOR_UNBONDING_SAFE", + "SHOW_VALIDATOR_UNBONDING_SAFE", + "LIST_VALIDATOR_UNBONDING_SAFE", + "RETRIEVE_VALIDATOR_UNBONDING_SAFE", +]; + +export const getDelegationSimiles = [ + "VIEW_DELEGATION", + "GET_DELEGATION", + "CHECK_DELEGATION", + "FETCH_DELEGATION", + "READ_DELEGATION", + "DISPLAY_DELEGATION", + "SHOW_DELEGATION", + "LIST_DELEGATION", + "RETRIEVE_DELEGATION", +]; + +export const getDelegationsSimiles = [ + "VIEW_DELEGATIONS", + "GET_DELEGATIONS", + "CHECK_DELEGATIONS", + "FETCH_DELEGATIONS", + "READ_DELEGATIONS", + "DISPLAY_DELEGATIONS", + "SHOW_DELEGATIONS", + "LIST_DELEGATIONS", + "RETRIEVE_DELEGATIONS", +]; + +export const getDelegationsNoThrowSimiles = [ + "VIEW_DELEGATIONS_SAFE", + "GET_DELEGATIONS_SAFE", + "CHECK_DELEGATIONS_SAFE", + "FETCH_DELEGATIONS_SAFE", + "READ_DELEGATIONS_SAFE", + "DISPLAY_DELEGATIONS_SAFE", + "SHOW_DELEGATIONS_SAFE", + "LIST_DELEGATIONS_SAFE", + "RETRIEVE_DELEGATIONS_SAFE", +]; + +export const getDelegatorsSimiles = [ + "VIEW_DELEGATORS", + "GET_DELEGATORS", + "CHECK_DELEGATORS", + "FETCH_DELEGATORS", + "READ_DELEGATORS", + "DISPLAY_DELEGATORS", + "SHOW_DELEGATORS", + "LIST_DELEGATORS", + "RETRIEVE_DELEGATORS", +]; + +export const getDelegatorsNoThrowSimiles = [ + "VIEW_DELEGATORS_SAFE", + "GET_DELEGATORS_SAFE", + "CHECK_DELEGATORS_SAFE", + "FETCH_DELEGATORS_SAFE", + "READ_DELEGATORS_SAFE", + "DISPLAY_DELEGATORS_SAFE", + "SHOW_DELEGATORS_SAFE", + "LIST_DELEGATORS_SAFE", + "RETRIEVE_DELEGATORS_SAFE", +]; + +export const getUnbondingDelegationsSimiles = [ + "VIEW_UNBONDING_DELEGATIONS", + "GET_UNBONDING_DELEGATIONS", + "CHECK_UNBONDING_DELEGATIONS", + "FETCH_UNBONDING_DELEGATIONS", + "READ_UNBONDING_DELEGATIONS", + "DISPLAY_UNBONDING_DELEGATIONS", + "SHOW_UNBONDING_DELEGATIONS", + "LIST_UNBONDING_DELEGATIONS", + "RETRIEVE_UNBONDING_DELEGATIONS", +]; + +export const getUnbondingDelegationsNoThrowSimiles = [ + "VIEW_UNBONDING_DELEGATIONS_SAFE", + "GET_UNBONDING_DELEGATIONS_SAFE", + "CHECK_UNBONDING_DELEGATIONS_SAFE", + "FETCH_UNBONDING_DELEGATIONS_SAFE", + "READ_UNBONDING_DELEGATIONS_SAFE", + "DISPLAY_UNBONDING_DELEGATIONS_SAFE", + "SHOW_UNBONDING_DELEGATIONS_SAFE", + "LIST_UNBONDING_DELEGATIONS_SAFE", + "RETRIEVE_UNBONDING_DELEGATIONS_SAFE", +]; + +export const getReDelegationsSimiles = [ + "VIEW_REDELEGATIONS", + "GET_REDELEGATIONS", + "CHECK_REDELEGATIONS", + "FETCH_REDELEGATIONS", + "READ_REDELEGATIONS", + "DISPLAY_REDELEGATIONS", + "SHOW_REDELEGATIONS", + "LIST_REDELEGATIONS", + "RETRIEVE_REDELEGATIONS", +]; + +export const getReDelegationsNoThrowSimiles = [ + "VIEW_REDELEGATIONS_SAFE", + "GET_REDELEGATIONS_SAFE", + "CHECK_REDELEGATIONS_SAFE", + "FETCH_REDELEGATIONS_SAFE", + "READ_REDELEGATIONS_SAFE", + "DISPLAY_REDELEGATIONS_SAFE", + "SHOW_REDELEGATIONS_SAFE", + "LIST_REDELEGATIONS_SAFE", + "RETRIEVE_REDELEGATIONS_SAFE", +]; + +// Message Actions +export const msgBeginRedelegateSimiles = [ + "START_REDELEGATION", + "BEGIN_REDELEGATION", + "INITIATE_REDELEGATION", + "CREATE_REDELEGATION", + "SUBMIT_REDELEGATION", + "EXECUTE_REDELEGATION", + "PROCESS_REDELEGATION", + "PERFORM_REDELEGATION", + "LAUNCH_REDELEGATION", +]; + +export const msgDelegateSimiles = [ + "START_DELEGATION", + "BEGIN_DELEGATION", + "INITIATE_DELEGATION", + "CREATE_DELEGATION", + "SUBMIT_DELEGATION", + "EXECUTE_DELEGATION", + "PROCESS_DELEGATION", + "PERFORM_DELEGATION", + "LAUNCH_DELEGATION", +]; + +export const msgUndelegateSimiles = [ + "START_UNDELEGATION", + "BEGIN_UNDELEGATION", + "INITIATE_UNDELEGATION", + "CREATE_UNDELEGATION", + "SUBMIT_UNDELEGATION", + "EXECUTE_UNDELEGATION", + "PROCESS_UNDELEGATION", + "PERFORM_UNDELEGATION", + "LAUNCH_UNDELEGATION", +]; + +export const msgCreateValidatorSimiles = [ + "CREATE_VALIDATOR", + "ESTABLISH_VALIDATOR", + "INITIALIZE_VALIDATOR", + "SETUP_VALIDATOR", + "REGISTER_VALIDATOR", + "START_VALIDATOR", + "LAUNCH_VALIDATOR", + "DEPLOY_VALIDATOR", + "INSTITUTE_VALIDATOR", +]; + +export const msgEditValidatorSimiles = [ + "UPDATE_VALIDATOR", + "MODIFY_VALIDATOR", + "CHANGE_VALIDATOR", + "EDIT_VALIDATOR", + "REVISE_VALIDATOR", + "ALTER_VALIDATOR", + "ADJUST_VALIDATOR", + "AMEND_VALIDATOR", + "TRANSFORM_VALIDATOR", +]; + +export const msgCancelUnbondingDelegationSimiles = [ + "CANCEL_UNBONDING", + "STOP_UNBONDING", + "HALT_UNBONDING", + "TERMINATE_UNBONDING", + "END_UNBONDING", + "ABORT_UNBONDING", + "WITHDRAW_UNBONDING", + "REVERSE_UNBONDING", + "NULLIFY_UNBONDING", +]; diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/similes/token-factory.ts b/packages/plugin-injective/injective-sdk-client-ts/src/similes/token-factory.ts new file mode 100644 index 00000000000..7120de01e24 --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/similes/token-factory.ts @@ -0,0 +1,109 @@ +// Query Actions +export const getDenomsFromCreatorSimiles = [ + "VIEW_CREATOR_TOKENS", + "GET_CREATOR_TOKENS", + "CHECK_CREATOR_TOKENS", + "FETCH_CREATOR_TOKENS", + "READ_CREATOR_TOKENS", + "DISPLAY_CREATOR_TOKENS", + "SHOW_CREATOR_TOKENS", + "LIST_CREATOR_TOKENS", + "RETRIEVE_CREATOR_TOKENS", +]; + +export const getDenomAuthorityMetadataSimiles = [ + "VIEW_TOKEN_AUTHORITY", + "GET_TOKEN_AUTHORITY", + "CHECK_TOKEN_AUTHORITY", + "FETCH_TOKEN_AUTHORITY", + "READ_TOKEN_AUTHORITY", + "DISPLAY_TOKEN_AUTHORITY", + "SHOW_TOKEN_AUTHORITY", + "LIST_TOKEN_AUTHORITY", + "RETRIEVE_TOKEN_AUTHORITY", +]; + +export const getTokenFactoryModuleParamsSimiles = [ + "VIEW_TOKEN_FACTORY_PARAMS", + "GET_TOKEN_FACTORY_PARAMS", + "CHECK_TOKEN_FACTORY_PARAMS", + "FETCH_TOKEN_FACTORY_PARAMS", + "READ_TOKEN_FACTORY_PARAMS", + "DISPLAY_TOKEN_FACTORY_PARAMS", + "SHOW_TOKEN_FACTORY_PARAMS", + "LIST_TOKEN_FACTORY_PARAMS", + "RETRIEVE_TOKEN_FACTORY_PARAMS", +]; + +export const getTokenFactoryModuleStateSimiles = [ + "VIEW_TOKEN_FACTORY_STATE", + "GET_TOKEN_FACTORY_STATE", + "CHECK_TOKEN_FACTORY_STATE", + "FETCH_TOKEN_FACTORY_STATE", + "READ_TOKEN_FACTORY_STATE", + "DISPLAY_TOKEN_FACTORY_STATE", + "SHOW_TOKEN_FACTORY_STATE", + "LIST_TOKEN_FACTORY_STATE", + "RETRIEVE_TOKEN_FACTORY_STATE", +]; + +// Message Actions +export const msgBurnSimiles = [ + "BURN_TOKENS", + "DESTROY_TOKENS", + "REMOVE_TOKENS", + "DELETE_TOKENS", + "ELIMINATE_TOKENS", + "CONSUME_TOKENS", + "ERASE_TOKENS", + "CANCEL_TOKENS", + "NULLIFY_TOKENS", +]; + +export const msgChangeAdminSimiles = [ + "UPDATE_TOKEN_ADMIN", + "CHANGE_TOKEN_ADMIN", + "MODIFY_TOKEN_ADMIN", + "TRANSFER_TOKEN_ADMIN", + "REPLACE_TOKEN_ADMIN", + "REASSIGN_TOKEN_ADMIN", + "SWITCH_TOKEN_ADMIN", + "ALTER_TOKEN_ADMIN", + "REVISE_TOKEN_ADMIN", +]; + +export const msgCreateDenomSimiles = [ + "CREATE_TOKEN_DENOM", + "ESTABLISH_TOKEN_DENOM", + "INITIALIZE_TOKEN_DENOM", + "SETUP_TOKEN_DENOM", + "GENERATE_TOKEN_DENOM", + "LAUNCH_TOKEN_DENOM", + "DEPLOY_TOKEN_DENOM", + "INSTITUTE_TOKEN_DENOM", + "PRODUCE_TOKEN_DENOM", +]; + +export const msgMintSimiles = [ + "MINT_TOKENS", + "ISSUE_TOKENS", + "GENERATE_TOKENS", + "CREATE_TOKENS", + "PRODUCE_TOKENS", + "MAKE_TOKENS", + "FORGE_TOKENS", + "FABRICATE_TOKENS", + "CONSTRUCT_TOKENS", +]; + +export const msgSetDenomMetadataSimiles = [ + "UPDATE_TOKEN_METADATA", + "SET_TOKEN_METADATA", + "MODIFY_TOKEN_METADATA", + "CHANGE_TOKEN_METADATA", + "REVISE_TOKEN_METADATA", + "ALTER_TOKEN_METADATA", + "ADJUST_TOKEN_METADATA", + "EDIT_TOKEN_METADATA", + "CONFIGURE_TOKEN_METADATA", +]; diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/similes/wasm.ts b/packages/plugin-injective/injective-sdk-client-ts/src/similes/wasm.ts new file mode 100644 index 00000000000..a73c8614589 --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/similes/wasm.ts @@ -0,0 +1,219 @@ +// Contract Query Actions +export const getContractAccountsBalanceSimiles = [ + "VIEW_CONTRACT_BALANCES", + "GET_CONTRACT_BALANCES", + "CHECK_CONTRACT_BALANCES", + "FETCH_CONTRACT_BALANCES", + "READ_CONTRACT_BALANCES", + "DISPLAY_CONTRACT_BALANCES", + "SHOW_CONTRACT_BALANCES", + "LIST_CONTRACT_BALANCES", + "RETRIEVE_CONTRACT_BALANCES", +]; + +export const getContractStateSimiles = [ + "VIEW_CONTRACT_STATE", + "GET_CONTRACT_STATE", + "CHECK_CONTRACT_STATE", + "FETCH_CONTRACT_STATE", + "READ_CONTRACT_STATE", + "DISPLAY_CONTRACT_STATE", + "SHOW_CONTRACT_STATE", + "LIST_CONTRACT_STATE", + "RETRIEVE_CONTRACT_STATE", +]; + +export const getContractInfoSimiles = [ + "VIEW_CONTRACT_INFO", + "GET_CONTRACT_INFO", + "CHECK_CONTRACT_INFO", + "FETCH_CONTRACT_INFO", + "READ_CONTRACT_INFO", + "DISPLAY_CONTRACT_INFO", + "SHOW_CONTRACT_INFO", + "LIST_CONTRACT_INFO", + "RETRIEVE_CONTRACT_INFO", +]; + +export const getContractHistorySimiles = [ + "VIEW_CONTRACT_HISTORY", + "GET_CONTRACT_HISTORY", + "CHECK_CONTRACT_HISTORY", + "FETCH_CONTRACT_HISTORY", + "READ_CONTRACT_HISTORY", + "DISPLAY_CONTRACT_HISTORY", + "SHOW_CONTRACT_HISTORY", + "LIST_CONTRACT_HISTORY", + "RETRIEVE_CONTRACT_HISTORY", +]; + +export const getSmartContractStateSimiles = [ + "VIEW_SMART_STATE", + "GET_SMART_STATE", + "CHECK_SMART_STATE", + "FETCH_SMART_STATE", + "READ_SMART_STATE", + "DISPLAY_SMART_STATE", + "SHOW_SMART_STATE", + "LIST_SMART_STATE", + "RETRIEVE_SMART_STATE", +]; + +export const getRawContractStateSimiles = [ + "VIEW_RAW_STATE", + "GET_RAW_STATE", + "CHECK_RAW_STATE", + "FETCH_RAW_STATE", + "READ_RAW_STATE", + "DISPLAY_RAW_STATE", + "SHOW_RAW_STATE", + "LIST_RAW_STATE", + "RETRIEVE_RAW_STATE", +]; + +// Code Query Actions +export const getContractCodesSimiles = [ + "VIEW_CONTRACT_CODES", + "GET_CONTRACT_CODES", + "CHECK_CONTRACT_CODES", + "FETCH_CONTRACT_CODES", + "READ_CONTRACT_CODES", + "DISPLAY_CONTRACT_CODES", + "SHOW_CONTRACT_CODES", + "LIST_CONTRACT_CODES", + "RETRIEVE_CONTRACT_CODES", +]; + +export const getContractCodeSimiles = [ + "VIEW_CONTRACT_CODE", + "GET_CONTRACT_CODE", + "CHECK_CONTRACT_CODE", + "FETCH_CONTRACT_CODE", + "READ_CONTRACT_CODE", + "DISPLAY_CONTRACT_CODE", + "SHOW_CONTRACT_CODE", + "LIST_CONTRACT_CODE", + "RETRIEVE_CONTRACT_CODE", +]; + +export const getContractCodeContractsSimiles = [ + "VIEW_CODE_CONTRACTS", + "GET_CODE_CONTRACTS", + "CHECK_CODE_CONTRACTS", + "FETCH_CODE_CONTRACTS", + "READ_CODE_CONTRACTS", + "DISPLAY_CODE_CONTRACTS", + "SHOW_CODE_CONTRACTS", + "LIST_CODE_CONTRACTS", + "RETRIEVE_CODE_CONTRACTS", +]; + +// Message Actions +export const msgStoreCodeSimiles = [ + "STORE_CONTRACT_CODE", + "UPLOAD_CONTRACT_CODE", + "DEPLOY_CONTRACT_CODE", + "SUBMIT_CONTRACT_CODE", + "PUBLISH_CONTRACT_CODE", + "REGISTER_CONTRACT_CODE", + "SAVE_CONTRACT_CODE", + "INSTALL_CONTRACT_CODE", + "PUSH_CONTRACT_CODE", +]; + +export const msgUpdateAdminSimiles = [ + "UPDATE_CONTRACT_ADMIN", + "CHANGE_CONTRACT_ADMIN", + "MODIFY_CONTRACT_ADMIN", + "TRANSFER_CONTRACT_ADMIN", + "REPLACE_CONTRACT_ADMIN", + "REASSIGN_CONTRACT_ADMIN", + "SWITCH_CONTRACT_ADMIN", + "ALTER_CONTRACT_ADMIN", + "REVISE_CONTRACT_ADMIN", +]; + +export const msgExecuteContractSimiles = [ + "EXECUTE_CONTRACT", + "RUN_CONTRACT", + "CALL_CONTRACT", + "INVOKE_CONTRACT", + "TRIGGER_CONTRACT", + "PERFORM_CONTRACT", + "PROCESS_CONTRACT", + "START_CONTRACT", + "OPERATE_CONTRACT", +]; + +export const msgMigrateContractSimiles = [ + "MIGRATE_CONTRACT", + "UPGRADE_CONTRACT", + "UPDATE_CONTRACT", + "TRANSFER_CONTRACT", + "MOVE_CONTRACT", + "SHIFT_CONTRACT", + "PORT_CONTRACT", + "TRANSITION_CONTRACT", + "CONVERT_CONTRACT", +]; + +export const msgInstantiateContractSimiles = [ + "CREATE_CONTRACT_INSTANCE", + "INSTANTIATE_CONTRACT", + "INITIALIZE_CONTRACT", + "DEPLOY_CONTRACT", + "LAUNCH_CONTRACT", + "START_CONTRACT_INSTANCE", + "SETUP_CONTRACT", + "ESTABLISH_CONTRACT", + "GENERATE_CONTRACT", +]; + +export const msgExecuteContractCompatSimiles = [ + "EXECUTE_COMPAT_CONTRACT", + "RUN_COMPAT_CONTRACT", + "CALL_COMPAT_CONTRACT", + "INVOKE_COMPAT_CONTRACT", + "TRIGGER_COMPAT_CONTRACT", + "PERFORM_COMPAT_CONTRACT", + "PROCESS_COMPAT_CONTRACT", + "START_COMPAT_CONTRACT", + "OPERATE_COMPAT_CONTRACT", +]; + +export const msgPrivilegedExecuteContractSimiles = [ + "EXECUTE_PRIVILEGED_CONTRACT", + "RUN_PRIVILEGED_CONTRACT", + "CALL_PRIVILEGED_CONTRACT", + "INVOKE_PRIVILEGED_CONTRACT", + "TRIGGER_PRIVILEGED_CONTRACT", + "PERFORM_PRIVILEGED_CONTRACT", + "PROCESS_PRIVILEGED_CONTRACT", + "START_PRIVILEGED_CONTRACT", + "OPERATE_PRIVILEGED_CONTRACT", +]; + +// WasmX Query Actions +export const getWasmxModuleParamsSimiles = [ + "VIEW_WASMX_PARAMS", + "GET_WASMX_PARAMS", + "CHECK_WASMX_PARAMS", + "FETCH_WASMX_PARAMS", + "READ_WASMX_PARAMS", + "DISPLAY_WASMX_PARAMS", + "SHOW_WASMX_PARAMS", + "LIST_WASMX_PARAMS", + "RETRIEVE_WASMX_PARAMS", +]; + +export const getWasmxModuleStateSimiles = [ + "VIEW_WASMX_STATE", + "GET_WASMX_STATE", + "CHECK_WASMX_STATE", + "FETCH_WASMX_STATE", + "READ_WASMX_STATE", + "DISPLAY_WASMX_STATE", + "SHOW_WASMX_STATE", + "LIST_WASMX_STATE", + "RETRIEVE_WASMX_STATE", +]; diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/template/auction.ts b/packages/plugin-injective/injective-sdk-client-ts/src/template/auction.ts new file mode 100644 index 00000000000..85fdaa8559f --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/template/auction.ts @@ -0,0 +1,212 @@ +// Auction Module Templates + +export const getAuctionModuleParamsTemplate = ` +Extract the following details to get auction module parameters: +- **auctionPeriod** (number): The duration of each auction period in seconds +- **minNextBidIncrementRate** (string): The minimum rate at which the next bid must increase + +Provide the response in the following JSON format: + +\`\`\`json +{ + "auctionPeriod": 3600, + "minNextBidIncrementRate": "0.1" +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getAuctionModuleStateTemplate = ` +Extract the following details for the auction module state: +- **params** (object): Module parameters containing: + - **auctionPeriod** (number): The duration of each auction period in seconds + - **minNextBidIncrementRate** (string): The minimum rate for next bid increment +- **auctionRound** (number): Current auction round number +- **highestBid** (object): Information about the highest bid: + - **bidder** (string): Address of the highest bidder + - **amount** (string): Amount of the highest bid +- **auctionEndingTimestamp** (number): Unix timestamp when the auction ends + +Provide the response in the following JSON format: + +\`\`\`json +{ + "params": { + "auctionPeriod": 3600, + "minNextBidIncrementRate": "0.1" + }, + "auctionRound": 5, + "highestBid": { + "bidder": "inj1...", + "amount": "1000000000" + }, + "auctionEndingTimestamp": 1632150400 +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getCurrentBasketTemplate = ` +Extract the following details for the current auction basket: +- **amountList** (array): List of amounts in the basket, each containing: + - **denom** (string): Token denomination (e.g., "inj") + - **amount** (string): Token amount +- **auctionRound** (number): Current auction round number +- **auctionClosingTime** (number): Unix timestamp when the auction closes +- **highestBidder** (string): Address of the current highest bidder +- **highestBidAmount** (string): Amount of the current highest bid + +Provide the response in the following JSON format: + +\`\`\`json +{ + "amountList": [ + { + "denom": "inj", + "amount": "1000000000" + } + ], + "auctionRound": 5, + "auctionClosingTime": 1632150400, + "highestBidder": "inj1...", + "highestBidAmount": "1000000000" +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getAuctionRoundTemplate = ` +Extract the following details for getting auction round information: +- **round** (number): The auction round number to query + +Ensure that: +1. Round number is positive +2. Round number exists in the system + +Provide the round parameter in the following JSON format: + +\`\`\`json +{ + "round": 5 +} +\`\`\` + +The response will contain: +- **auction** (object): Auction information containing: + - **winner** (string): Address of the auction winner + - **basketList** (array): List of tokens in the basket + - **winningBidAmount** (string): Amount of the winning bid + - **round** (number): Round number + - **endTimestamp** (number): Unix timestamp when the round ended + - **updatedAt** (number): Last update timestamp +- **bids** (array): List of bids in the round, each containing: + - **bidder** (string): Address of the bidder + - **bidAmount** (string): Bid amount + - **bidTimestamp** (number): When the bid was placed + +Response format: + +\`\`\`json +{ + "auction": { + "winner": "inj1...", + "basketList": [ + { + "denom": "inj", + "amount": "1000000000" + } + ], + "winningBidAmount": "1000000000", + "round": 5, + "endTimestamp": 1632150400, + "updatedAt": 1632150400 + }, + "bids": [ + { + "bidder": "inj1...", + "bidAmount": "1000000000", + "bidTimestamp": 1632150300 + } + ] +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getAuctionsTemplate = ` +Extract details for retrieving multiple auctions. The response will provide: +- **auction** (array): List of auctions, each containing: + - **winner** (string): Address of the auction winner + - **basketList** (array): List of tokens in the basket + - **winningBidAmount** (string): Amount of the winning bid + - **round** (number): Auction round number + - **endTimestamp** (number): Unix timestamp when the auction ended + - **updatedAt** (number): Last update timestamp + +Provide the response in the following JSON format: + +\`\`\`json +[ + { + "winner": "inj1...", + "basketList": [ + { + "denom": "inj", + "amount": "1000000000" + } + ], + "winningBidAmount": "1000000000", + "round": 5, + "endTimestamp": 1632150400, + "updatedAt": 1632150400 + } +] +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const msgBidTemplate = ` +Extract the following details for placing a bid: +- **round** (number): The auction round number to bid in +- **amount** (string): The bid amount in INJ_DENOM + +Ensure that: +1. Round number is positive and exists in the system +2. Amount is positive and properly formatted +3. Amount is greater than the current highest bid plus minimum increment + +Provide the bid details in the following JSON format: + +\`\`\`json +{ + "round": 5, + "amount": "1000000000" +} +\`\`\` + +A successful response will include: +- **txHash** (string): The transaction hash +- **success** (boolean): Whether the bid was successful + +Response format: + +\`\`\`json +{ + "txHash": "0x...", + "success": true +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/template/auth.ts b/packages/plugin-injective/injective-sdk-client-ts/src/template/auth.ts new file mode 100644 index 00000000000..6fb8a639611 --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/template/auth.ts @@ -0,0 +1,330 @@ +export const getAuthModuleParamsTemplate = ` +Extract the following details for auth module parameters: +- **maxMemoCharacters** (number): Maximum number of characters allowed in memo +- **txSigLimit** (number): Transaction signature limit +- **txSizeCostPerByte** (number): Cost per byte for transaction size +- **sigVerifyCostEd25519** (number): Cost for Ed25519 signature verification +- **sigVerifyCostSecp256k1** (number): Cost for Secp256k1 signature verification + +Provide the response in the following JSON format: + +\`\`\`json +{ + "maxMemoCharacters": 256, + "txSigLimit": 7, + "txSizeCostPerByte": 10, + "sigVerifyCostEd25519": 590, + "sigVerifyCostSecp256k1": 1000 +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getAccountDetailsTemplate = ` +Extract the following details for account information: +- **codeHash** (string): Hash of the account's code +- **baseAccount** (object): Base account information containing: + - **address** (string): Account address + - **pubKey** (object, optional): Public key information: + - **key** (string): The public key + - **typeUrl** (string): Type URL of the public key + - **accountNumber** (number): Account number + - **sequence** (number): Account sequence + +Provide the response in the following JSON format: + +\`\`\`json +{ + "codeHash": "0x...", + "baseAccount": { + "address": "inj1...", + "pubKey": { + "key": "key_string", + "typeUrl": "/cosmos.crypto.secp256k1.PubKey" + }, + "accountNumber": 12345, + "sequence": 67890 + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getAccountsTemplate = ` +Extract the following details for multiple accounts: +- **pagination** (object): Pagination information containing: + - **nextKey** (string): Key for the next page + - **total** (number): Total number of items +- **accounts** (array): List of accounts, each containing: + - **codeHash** (string): Hash of the account's code + - **baseAccount** (object): Base account information + +Provide the response in the following JSON format: + +\`\`\`json +{ + "pagination": { + "nextKey": "next_page_key", + "total": 100 + }, + "accounts": [ + { + "codeHash": "0x...", + "baseAccount": { + "address": "inj1...", + "pubKey": { + "key": "key_string", + "typeUrl": "/cosmos.crypto.secp256k1.PubKey" + }, + "accountNumber": 12345, + "sequence": 67890 + } + } + ] +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getGrantsTemplate = ` +Extract the following details for fetching grants: +- **pagination** (object, optional): Pagination options +- **granter** (string): Address of the granter +- **grantee** (string): Address of the grantee +- **msgTypeUrl** (string, optional): Type of message authorization + +Provide the request in the following JSON format: + +\`\`\`json +{ + "pagination": { + "key": "base64_encoded_key", + "offset": 0, + "limit": 100, + "reverse": false + }, + "granter": "inj1...", + "grantee": "inj1...", + "msgTypeUrl": "/cosmos.bank.v1beta1.MsgSend" +} +\`\`\` + +Response format: + +\`\`\`json +{ + "pagination": { + "nextKey": "next_page_key", + "total": 100 + }, + "grants": [ + { + "authorization": { + "@type": "/cosmos.authz.v1beta1.GenericAuthorization", + "msg": "/cosmos.bank.v1beta1.MsgSend" + }, + "authorizationType": "GenericAuthorization", + "expiration": "2024-12-31T23:59:59Z" + } + ] +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getGranterGrantsTemplate = ` +Extract the following details for fetching granter's grants: +- **granter** (string): Address of the granter +- **pagination** (object, optional): Pagination options + +Provide the request in the following JSON format: + +\`\`\`json +{ + "granter": "inj1...", + "pagination": { + "key": "base64_encoded_key", + "offset": 0, + "limit": 100, + "reverse": false + } +} +\`\`\` + +Response format: + +\`\`\`json +{ + "pagination": { + "nextKey": "next_page_key", + "total": 100 + }, + "grants": [ + { + "granter": "inj1...", + "grantee": "inj1...", + "authorization": { + "@type": "/cosmos.authz.v1beta1.GenericAuthorization", + "msg": "/cosmos.bank.v1beta1.MsgSend" + }, + "authorizationType": "GenericAuthorization", + "expiration": "2024-12-31T23:59:59Z" + } + ] +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getGranteeGrantsTemplate = ` +Extract the following details for fetching grantee's grants: +- **grantee** (string): Address of the grantee +- **pagination** (object, optional): Pagination options + +Provide the request in the following JSON format: + +\`\`\`json +{ + "grantee": "inj1...", + "pagination": { + "key": "base64_encoded_key", + "offset": 0, + "limit": 100, + "reverse": false + } +} +\`\`\` + +Response format: + +\`\`\`json +{ + "pagination": { + "nextKey": "next_page_key", + "total": 100 + }, + "grants": [ + { + "granter": "inj1...", + "grantee": "inj1...", + "authorization": { + "@type": "/cosmos.authz.v1beta1.GenericAuthorization", + "msg": "/cosmos.bank.v1beta1.MsgSend" + }, + "authorizationType": "GenericAuthorization", + "expiration": "2024-12-31T23:59:59Z" + } + ] +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const msgGrantTemplate = ` +Extract the following details for granting authorization: +- **messageType** (string): Type of message to authorize +- **grantee** (string): Address of the grantee +- **granter** (string): Address of the granter + +Provide the request in the following JSON format: + +\`\`\`json +{ + "messageType": "/cosmos.bank.v1beta1.MsgSend", + "grantee": "inj1...", + "granter": "inj1..." +} +\`\`\` + +Response format: + +\`\`\`json +{ + "txHash": "0x...", + "success": true +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const msgExecTemplate = ` +Extract the following details for executing authorized messages: +- **grantee** (string): Address of the grantee executing the messages +- **msgs** (array): Array of messages to execute + +Provide the request in the following JSON format: + +\`\`\`json +{ + "grantee": "inj1...", + "msgs": [ + { + "@type": "/cosmos.bank.v1beta1.MsgSend", + "fromAddress": "inj1...", + "toAddress": "inj1...", + "amount": [ + { + "denom": "inj", + "amount": "1000000000" + } + ] + } + ] +} +\`\`\` + +Response format: + +\`\`\`json +{ + "txHash": "0x...", + "success": true +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const msgRevokeTemplate = ` +Extract the following details for revoking authorization: +- **messageType** (string): Type of message authorization to revoke +- **grantee** (string): Address of the grantee +- **granter** (string): Address of the granter + +Provide the request in the following JSON format: + +\`\`\`json +{ + "messageType": "/cosmos.bank.v1beta1.MsgSend", + "grantee": "inj1...", + "granter": "inj1..." +} +\`\`\` + +Response format: + +\`\`\`json +{ + "txHash": "0x...", + "success": true +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/template/bank.ts b/packages/plugin-injective/injective-sdk-client-ts/src/template/bank.ts new file mode 100644 index 00000000000..2cdd091fd88 --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/template/bank.ts @@ -0,0 +1,372 @@ +export const getBankModuleParamsTemplate = ` +Extract the following details for bank module parameters: +- **sendEnabledList** (array): List of send-enabled denominations containing: + - **denom** (string): Denomination + - **enabled** (boolean): Whether sending is enabled +- **defaultSendEnabled** (boolean): Default send enabled status + +Provide the response in the following JSON format: + +\`\`\`json +{ + "sendEnabledList": [ + { + "denom": "inj", + "enabled": true + } + ], + "defaultSendEnabled": true +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getBankBalanceTemplate = ` +Extract the following details for bank balance: +- **accountAddress** (string): Address of the account +- **denom** (string): Denomination to query + +Provide the request in the following JSON format: + +\`\`\`json +{ + "accountAddress": "inj1...", + "denom": "inj" +} +\`\`\` + +Response format: + +\`\`\`json +{ + "denom": "inj", + "amount": "1000000000" +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getBankBalancesTemplate = ` +Extract the following details for all bank balances: +- **accountAddress** (string): Address of the account +- **pagination** (object, optional): Pagination options + +Provide the request in the following JSON format: + +\`\`\`json +{ + "accountAddress": "inj1...", + "pagination": { + "key": "base64_encoded_key", + "offset": 0, + "limit": 100, + "reverse": false + } +} +\`\`\` + +Response format: + +\`\`\`json +{ + "balances": [ + { + "denom": "inj", + "amount": "1000000000" + } + ], + "pagination": { + "nextKey": "next_page_key", + "total": 100 + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getTotalSupplyTemplate = ` +Extract total supply with optional pagination. + +Response format: + +\`\`\`json +{ + "supply": [ + { + "denom": "inj", + "amount": "1000000000000" + } + ], + "pagination": { + "nextKey": "next_page_key", + "total": 100 + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getAllTotalSupplyTemplate = ` +Extract complete total supply for all denominations. + +Response format: + +\`\`\`json +{ + "supply": [ + { + "denom": "inj", + "amount": "1000000000000" + } + ], + "pagination": { + "nextKey": "next_page_key", + "total": 100 + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getSupplyOfTemplate = ` +Extract the following details for supply of specific denomination: +- **denom** (string): Denomination to query + +Provide the request in the following JSON format: + +\`\`\`json +{ + "denom": "inj" +} +\`\`\` + +Response format: + +\`\`\`json +{ + "denom": "inj", + "amount": "1000000000000" +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getDenomsMetadataTemplate = ` +Extract metadata for all denominations with optional pagination. + +Response format: + +\`\`\`json +{ + "metadatas": [ + { + "description": "The native staking token of the Injective blockchain", + "denom_units": [ + { + "denom": "inj", + "exponent": 0, + "aliases": ["inj"] + } + ], + "base": "inj", + "display": "inj", + "name": "Injective", + "symbol": "INJ" + } + ], + "pagination": { + "nextKey": "next_page_key", + "total": 100 + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getDenomMetadataTemplate = ` +Extract the following details for denomination metadata: +- **denom** (string): Denomination to query + +Provide the request in the following JSON format: + +\`\`\`json +{ + "denom": "inj" +} +\`\`\` + +Response format: + +\`\`\`json +{ + "description": "The native staking token of the Injective blockchain", + "denom_units": [ + { + "denom": "inj", + "exponent": 0, + "aliases": ["inj"] + } + ], + "base": "inj", + "display": "inj", + "name": "Injective", + "symbol": "INJ" +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getDenomOwnersTemplate = ` +Extract the following details for denomination owners: +- **denom** (string): Denomination to query +- **pagination** (object, optional): Pagination options + +Provide the request in the following JSON format: + +\`\`\`json +{ + "denom": "inj", + "pagination": { + "key": "base64_encoded_key", + "offset": 0, + "limit": 100, + "reverse": false + } +} +\`\`\` + +Response format: + +\`\`\`json +{ + "denomOwners": [ + { + "address": "inj1...", + "balance": { + "denom": "inj", + "amount": "1000000000" + } + } + ], + "pagination": { + "nextKey": "next_page_key", + "total": 100 + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const msgSendTemplate = ` +Extract the following details for sending tokens: +- **srcInjectiveAddress** (string): Source address +- **dstInjectiveAddress** (string): Destination address +- **amount** (object): Amount to send containing: + - **denom** (string): Token denomination + - **amount** (string): Token amount + +Provide the request in the following JSON format: + +\`\`\`json +{ + "srcInjectiveAddress": "inj1...", + "dstInjectiveAddress": "inj1...", + "amount": { + "denom": "inj", + "amount": "1000000000" + } +} +\`\`\` + +Response format: + +\`\`\`json +{ + "txHash": "0x...", + "success": true +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const msgMultiSendTemplate = ` +Extract the following details for multi-send transaction: +- **inputs** (array): List of input addresses and amounts +- **outputs** (array): List of output addresses and amounts + +Each input/output contains: +- **address** (string): Injective address +- **amount** (array): List of coins containing: + - **denom** (string): Token denomination + - **amount** (string): Token amount + +Provide the request in the following JSON format: + +\`\`\`json +{ + "inputs": [ + { + "address": "inj1...", + "coins": [ + { + "denom": "inj", + "amount": "1000000000" + } + ] + } + ], + "outputs": [ + { + "address": "inj1...", + "coins": [ + { + "denom": "inj", + "amount": "500000000" + } + ] + }, + { + "address": "inj1...", + "coins": [ + { + "denom": "inj", + "amount": "500000000" + } + ] + } + ] +} +\`\`\` + +Response format: + +\`\`\`json +{ + "txHash": "0x...", + "success": true +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/template/base.ts b/packages/plugin-injective/injective-sdk-client-ts/src/template/base.ts new file mode 100644 index 00000000000..c27ea1254aa --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/template/base.ts @@ -0,0 +1,31 @@ +// base-templates.ts +export const paginationParamsTemplate = ` +Extract pagination parameters: +- Pagination: {{pagination}} (PaginationOption?) - Optional pagination configuration + - Key: {{pagination.key}} (string?) - Optional pagination key + - Offset: {{pagination.offset}} (number?) - Optional offset + - Limit: {{pagination.limit}} (number?) - Optional limit + - Reverse: {{pagination.reverse}} (boolean?) - Optional reverse order flag +`; + +export const addressParamsTemplate = ` +Extract address parameters: +- Address: {{address}} (string) - Account address +`; + +export const timeRangeParamsTemplate = ` +Extract time range parameters: +- Start Time: {{startTime}} (number?) - Optional start timestamp +- End Time: {{endTime}} (number?) - Optional end timestamp +`; + +export const denomParamTemplate = ` +Extract denomination parameters: +- Denom: {{denom}} (string) - Token denomination +`; + +export const standardResponseTemplate = ` +Extract standard response structure: +- Success: {{success}} (boolean) - Operation success status +- Result: {{result}} (T) - Response data of generic type T +`; diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/template/distribution.ts b/packages/plugin-injective/injective-sdk-client-ts/src/template/distribution.ts new file mode 100644 index 00000000000..194c748988c --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/template/distribution.ts @@ -0,0 +1,195 @@ +export const getDistributionModuleParamsTemplate = ` +Extract the following details for distribution module parameters: +- **communityTax** (string): Tax rate for community fund +- **baseProposerReward** (string): Base reward for block proposer +- **bonusProposerReward** (string): Bonus reward for block proposer +- **withdrawAddrEnabled** (boolean): Whether withdraw address modification is enabled + +Provide the response in the following JSON format: + +\`\`\`json +{ + "communityTax": "0.020000000000000000", + "baseProposerReward": "0.010000000000000000", + "bonusProposerReward": "0.040000000000000000", + "withdrawAddrEnabled": true +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getDelegatorRewardsForValidatorTemplate = ` +Extract the following details for delegator rewards from specific validator: +- **delegatorAddress** (string): Address of the delegator +- **validatorAddress** (string): Address of the validator + +Provide the request in the following JSON format: + +\`\`\`json +{ + "delegatorAddress": "inj1...", + "validatorAddress": "injvaloper1..." +} +\`\`\` + +Response format: + +\`\`\`json +[ + { + "denom": "inj", + "amount": "1000000000" + } +] +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getDelegatorRewardsForValidatorNoThrowTemplate = ` +Extract the following details for delegator rewards from specific validator (no-throw version): +- **delegatorAddress** (string): Address of the delegator +- **validatorAddress** (string): Address of the validator + +Provide the request in the following JSON format: + +\`\`\`json +{ + "delegatorAddress": "inj1...", + "validatorAddress": "injvaloper1..." +} +\`\`\` + +Response format: + +\`\`\`json +[ + { + "denom": "inj", + "amount": "1000000000" + } +] +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getDelegatorRewardsTemplate = ` +Extract the following details for delegator rewards: +- **injectiveAddress** (string): Address of the delegator + +Provide the request in the following JSON format: + +\`\`\`json +{ + "injectiveAddress": "inj1..." +} +\`\`\` + +Response format: + +\`\`\`json +[ + { + "validatorAddress": "injvaloper1...", + "rewards": [ + { + "denom": "inj", + "amount": "1000000000" + } + ] + } +] +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getDelegatorRewardsNoThrowTemplate = ` +Extract the following details for delegator rewards (no-throw version): +- **injectiveAddress** (string): Address of the delegator + +Provide the request in the following JSON format: + +\`\`\`json +{ + "injectiveAddress": "inj1..." +} +\`\`\` + +Response format: + +\`\`\`json +[ + { + "validatorAddress": "injvaloper1...", + "rewards": [ + { + "denom": "inj", + "amount": "1000000000" + } + ] + } +] +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const msgWithdrawDelegatorRewardTemplate = ` +Extract the following details for withdrawing delegator rewards: +- **delegatorAddress** (string): Address of the delegator +- **validatorAddress** (string): Address of the validator + +Provide the request in the following JSON format: + +\`\`\`json +{ + "delegatorAddress": "inj1...", + "validatorAddress": "injvaloper1..." +} +\`\`\` + +Response format: + +\`\`\`json +{ + "txHash": "0x...", + "success": true +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const msgWithdrawValidatorCommissionTemplate = ` +Extract the following details for withdrawing validator commission: +- **validatorAddress** (string): Address of the validator + +Provide the request in the following JSON format: + +\`\`\`json +{ + "validatorAddress": "injvaloper1..." +} +\`\`\` + +Response format: + +\`\`\`json +{ + "txHash": "0x...", + "success": true +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/template/exchange.ts b/packages/plugin-injective/injective-sdk-client-ts/src/template/exchange.ts new file mode 100644 index 00000000000..902510178ed --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/template/exchange.ts @@ -0,0 +1,3100 @@ +export const getAccountPortfolioTemplate = ` +Extract the following details for account portfolio: +- **address** (string): Account address + +Provide the request in the following JSON format: + +\`\`\`json +{ + "address": "inj1..." +} +\`\`\` + +Response format: + +\`\`\`json +{ + "accountAddress": "inj1...", + "bankBalancesList": [ + { + "amount": "1000000", + "denom": "inj" + } + ], + "subaccountsList": [ + { + "subaccountId": "subaccount_id", + "denom": "inj", + "deposit": { + "totalBalance": "1000000", + "availableBalance": "900000" + } + } + ], + "positionsWithUpnlList": [ + { + "position": { + "marketId": "market_id", + "subaccountId": "subaccount_id", + "direction": "long", + "quantity": "1.5", + "entryPrice": "25000.5", + "margin": "1000", + "liquidationPrice": "24000.0", + "markPrice": "25100.0", + "ticker": "BTC/USDT" + }, + "unrealizedPnl": "150.75" + } + ] +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getSubaccountHistoryTemplate = ` +Extract the following details for subaccount history: +- **subaccountId** (string): Subaccount ID +- **denom** (string, optional): Token denomination +- **transferTypes** (string[], optional): Types of transfers to include +- **pagination** (object, optional): Pagination options + +Provide the request in the following JSON format: + +\`\`\`json +{ + "subaccountId": "subaccount_id", + "denom": "inj", + "transferTypes": ["deposit", "withdraw"], + "pagination": { + "from": 1, + "to": 100, + "limit": 10 + } +} +\`\`\` + +Response format: + +\`\`\`json +{ + "transfers": [ + { + "transferType": "deposit", + "srcSubaccountId": "src_subaccount_id", + "srcSubaccountAddress": "inj1...", + "dstSubaccountId": "dst_subaccount_id", + "dstSubaccountAddress": "inj1...", + "amount": { + "amount": "1000000", + "denom": "inj" + }, + "executedAt": 1641859200 + } + ], + "pagination": { + "total": 100 + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getSpotMarketTemplate = ` +Extract the following details for spot market lookup: +- **marketId** (string): Market ID + +Provide the request in the following JSON format: + +\`\`\`json +{ + "marketId": "market_id" +} +\`\`\` + +Response format: + +\`\`\`json +{ + "marketId": "market_id", + "marketStatus": "active", + "ticker": "INJ/USDT", + "baseDenom": "inj", + "quoteDenom": "usdt", + "makerFeeRate": "0.001", + "takerFeeRate": "0.002", + "serviceProviderFee": "0.4", + "minPriceTickSize": 0.000001, + "minQuantityTickSize": 0.000001 +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getDerivativeMarketTemplate = ` +Extract the following details for derivative market lookup: +- **marketId** (string): Market ID + +Provide the request in the following JSON format: + +\`\`\`json +{ + "marketId": "market_id" +} +\`\`\` + +Response format: + +\`\`\`json +{ + "marketId": "market_id", + "marketStatus": "active", + "ticker": "BTC/USDT PERP", + "oracleBase": "BTC", + "oracleQuote": "USDT", + "quoteDenom": "usdt", + "makerFeeRate": "0.001", + "takerFeeRate": "0.002", + "serviceProviderFee": "0.4", + "initialMarginRatio": "0.05", + "maintenanceMarginRatio": "0.02", + "isPerpetual": true, + "minPriceTickSize": 0.01, + "minQuantityTickSize": 0.001 +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getExchangePositionsTemplate = ` +Extract the exchange module's open positions +Response format: + +\`\`\`json +{ + "positions": [ + { + "marketId": "market_id", + "subaccountId": "subaccount_id", + "direction": "long", + "quantity": "1.5", + "entryPrice": "25000.5", + "margin": "1000", + "liquidationPrice": "24000.0", + "markPrice": "25100.0", + "ticker": "BTC/USDT" + } + ], + "pagination": { + "total": 100 + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getExchangeInsuranceFundsTemplate = ` +Extract insurance funds information. + +Response format: + +\`\`\`json +{ + "funds": [ + { + "depositDenom": "inj", + "insurancePoolTokenDenom": "insurance_pool_token", + "redemptionNoticePeriodDuration": 1209600, + "balance": "1000000", + "totalShare": "1000000", + "marketId": "market_id", + "marketTicker": "BTC/USDT PERP", + "oracleBase": "BTC", + "oracleQuote": "USDT", + "oracleType": "band", + "expiry": 0 + } + ] +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getRedemptionsTemplate = ` +Extract the following details for redemptions query: +- **address** (string): Account address +- **denom** (string, optional): Token denomination +- **status** (string, optional): Redemption status + +Provide the request in the following JSON format: + +\`\`\`json +{ + "address": "inj1...", + "denom": "inj", + "status": "pending" +} +\`\`\` + +Response format: + +\`\`\`json +{ + "redemptions": [ + { + "redemptionId": 1, + "status": "pending", + "redeemer": "inj1...", + "claimableRedemptionTime": 1641859200, + "redemptionAmount": "1000000", + "redemptionDenom": "inj", + "requestedAt": 1641772800, + "disbursedAmount": "0", + "disbursedDenom": "", + "disbursedAt": 0 + } + ] +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getSpotOrdersTemplate = ` +Extract the following details for spot orders query: +- **marketId** (string, optional): Market ID filter +- **marketIds** (string[], optional): Multiple market IDs filter +- **subaccountId** (string, optional): Subaccount ID filter +- **orderSide** (string, optional): Order side (buy/sell) +- **isConditional** (boolean, optional): Whether order is conditional +- **pagination** (object, optional): Pagination options + +Provide the request in the following JSON format: + +\`\`\`json +{ + "marketId": "market_id", + "marketIds": ["market_id1", "market_id2"], + "subaccountId": "subaccount_id", + "orderSide": "buy", + "isConditional": false, + "pagination": { + "from": 1, + "to": 100, + "limit": 10 + } +} +\`\`\` + +Response format: + +\`\`\`json +{ + "orders": [ + { + "orderHash": "0x...", + "orderSide": "buy", + "marketId": "market_id", + "subaccountId": "subaccount_id", + "price": "25000.5", + "quantity": "1.5", + "unfilledQuantity": "0.5", + "triggerPrice": "0", + "feeRecipient": "inj1...", + "state": "booked", + "createdAt": 1641859200, + "updatedAt": 1641859200 + } + ], + "pagination": { + "total": 100 + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getDerivativeOrdersTemplate = ` +Extract the following details for derivative orders query: +- **marketId** (string, optional): Market ID filter +- **marketIds** (string[], optional): Multiple market IDs filter +- **subaccountId** (string, optional): Subaccount ID filter +- **orderSide** (string, optional): Order side (buy/sell) +- **isConditional** (boolean, optional): Whether order is conditional +- **pagination** (object, optional): Pagination options + +Provide the request in the following JSON format: + +\`\`\`json +{ + "marketId": "market_id", + "marketIds": ["market_id1", "market_id2"], + "subaccountId": "subaccount_id", + "orderSide": "buy", + "isConditional": false, + "pagination": { + "from": 1, + "to": 100, + "limit": 10 + } +} +\`\`\` + +Response format: + +\`\`\`json +{ + "orders": [ + { + "orderHash": "0x...", + "orderSide": "buy", + "marketId": "market_id", + "subaccountId": "subaccount_id", + "margin": "1000", + "price": "25000.5", + "quantity": "1.5", + "unfilledQuantity": "0.5", + "triggerPrice": "0", + "feeRecipient": "inj1...", + "state": "booked", + "createdAt": 1641859200, + "updatedAt": 1641859200 + } + ], + "pagination": { + "total": 100 + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getHistoricalTradesTemplate = ` +Extract the following details for historical trades query: +- **marketId** (string, optional): Market ID filter +- **marketIds** (string[], optional): Multiple market IDs filter +- **subaccountId** (string, optional): Subaccount ID filter +- **endTime** (number, optional): End timestamp +- **startTime** (number, optional): Start timestamp +- **direction** (string, optional): Trade direction +- **pagination** (object, optional): Pagination options + +Provide the request in the following JSON format: + +\`\`\`json +{ + "marketId": "market_id", + "marketIds": ["market_id1", "market_id2"], + "subaccountId": "subaccount_id", + "endTime": 1641945600, + "startTime": 1641859200, + "direction": "buy", + "pagination": { + "from": 1, + "to": 100, + "limit": 10 + } +} +\`\`\` + +Response format: + +\`\`\`json +{ + "trades": [ + { + "orderHash": "0x...", + "subaccountId": "subaccount_id", + "marketId": "market_id", + "tradeId": "trade_id", + "executedAt": 1641859200, + "tradeExecutionType": "limit", + "tradeDirection": "buy", + "executionPrice": "25000.5", + "executionQuantity": "1.5", + "fee": "0.5", + "feeRecipient": "inj1..." + } + ], + "pagination": { + "total": 100 + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getFundingRatesTemplate = ` +Extract the following details for funding rates query: +- **marketId** (string, optional): Market ID filter +- **pagination** (object, optional): Pagination options + +Provide the request in the following JSON format: + +\`\`\`json +{ + "marketId": "market_id", + "pagination": { + "from": 1, + "to": 100, + "limit": 10 + } +} +\`\`\` + +Response format: + +\`\`\`json +{ + "fundingRates": [ + { + "marketId": "market_id", + "rate": "0.0001", + "timestamp": 1641859200 + } + ], + "pagination": { + "total": 100 + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +// Account & Portfolio Related Templates +export const msgDepositTemplate = ` +Extract the following details for deposit: +- **injectiveAddress** (string): Injective sender address +- **subaccountId** (string): Subaccount ID to deposit to +- **amount** (string): Amount to deposit + +Provide the request in the following JSON format: + +\`\`\`json +{ + "injectiveAddress": "inj1...", + "subaccountId": "0x...", + "amount": "1000000" +} +\`\`\` + +Response format: + +\`\`\`json +{ + "success": true, + "txHash": "0x..." +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const msgWithdrawTemplate = ` +Extract the following details for withdrawal: +- **injectiveAddress** (string): Injective sender address +- **subaccountId** (string): Subaccount ID to withdraw from +- **amount** (string): Amount to withdraw + +Provide the request in the following JSON format: + +\`\`\`json +{ + "injectiveAddress": "inj1...", + "subaccountId": "0x...", + "amount": "1000000" +} +\`\`\` + +Response format: + +\`\`\`json +{ + "success": true, + "txHash": "0x..." +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +// Order Related Templates +export const msgCreateSpotMarketOrderTemplate = ` +Extract the following details for creating spot market order: +- **marketId** (string): Market ID +- **subaccountId** (string): Subaccount ID +- **injectiveAddress** (string): Injective sender address +- **orderType** (string): Order type (BUY/SELL) +- **price** (string): Order price +- **quantity** (string): Order quantity + +Provide the request in the following JSON format: + +\`\`\`json +{ + "marketId": "0x...", + "subaccountId": "0x...", + "injectiveAddress": "inj1...", + "orderType": "BUY", + "price": "25000.5", + "quantity": "0.5" +} +\`\`\` + +Response format: + +\`\`\`json +{ + "orderHash": "0x...", + "txHash": "0x..." +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const msgCreateDerivativeMarketOrderTemplate = ` +Extract the following details for creating derivative market order: +- **marketId** (string): Market ID +- **subaccountId** (string): Subaccount ID +- **injectiveAddress** (string): Injective sender address +- **orderType** (string): Order type (BUY/SELL) +- **price** (string): Order price +- **quantity** (string): Order quantity +- **margin** (string): Order margin +- **leverage** (string): Order leverage + +Provide the request in the following JSON format: + +\`\`\`json +{ + "marketId": "0x...", + "subaccountId": "0x...", + "injectiveAddress": "inj1...", + "orderType": "BUY", + "price": "25000.5", + "quantity": "0.5", + "margin": "1000", + "leverage": "10" +} +\`\`\` + +Response format: + +\`\`\`json +{ + "orderHash": "0x...", + "txHash": "0x..." +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const msgBatchCancelOrdersTemplate = ` +Extract the following details for batch canceling orders: +- **injectiveAddress** (string): Injective sender address +- **orders** (array): List of orders to cancel containing: + - marketId (string) + - subaccountId (string) + - orderHash (string) + - orderMask (number) + +Provide the request in the following JSON format: + +\`\`\`json +{ + "injectiveAddress": "inj1...", + "orders": [ + { + "marketId": "0x...", + "subaccountId": "0x...", + "orderHash": "0x...", + "orderMask": 1 + } + ] +} +\`\`\` + +Response format: + +\`\`\`json +{ + "success": true, + "txHash": "0x..." +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const msgBatchUpdateOrdersTemplate = ` +Extract the following details for batch updating orders: +- **injectiveAddress** (string): Injective sender address +- **spotOrders** (array, optional): List of spot orders to update +- **derivativeOrders** (array, optional): List of derivative orders to update +Each order contains: + - marketId (string) + - subaccountId (string) + - orderHash (string, optional) + - orderType (string) + - price (string) + - quantity (string) + +Provide the request in the following JSON format: + +\`\`\`json +{ + "injectiveAddress": "inj1...", + "spotOrders": [ + { + "marketId": "0x...", + "subaccountId": "0x...", + "orderHash": "0x...", + "orderType": "BUY", + "price": "25000.5", + "quantity": "0.5" + } + ], + "derivativeOrders": [ + { + "marketId": "0x...", + "subaccountId": "0x...", + "orderHash": "0x...", + "orderType": "SELL", + "price": "25100.5", + "quantity": "1.0" + } + ] +} +\`\`\` + +Response format: + +\`\`\`json +{ + "spotOrderHashes": ["0x..."], + "derivativeOrderHashes": ["0x..."], + "txHash": "0x..." +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const msgExternalTransferTemplate = ` +Extract the following details for external transfer: +- **injectiveAddress** (string): Injective sender address +- **sourceSubaccountId** (string): Source subaccount ID +- **destinationSubaccountId** (string): Destination subaccount ID +- **amount** (string): Amount to transfer + +Provide the request in the following JSON format: + +\`\`\`json +{ + "injectiveAddress": "inj1...", + "sourceSubaccountId": "0x...", + "destinationSubaccountId": "0x...", + "amount": "1000000" +} +\`\`\` + +Response format: + +\`\`\`json +{ + "success": true, + "txHash": "0x..." +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const msgIncreasePositionMarginTemplate = ` +Extract the following details for increasing position margin: +- **injectiveAddress** (string): Injective sender address +- **marketId** (string): Market ID +- **sourceSubaccountId** (string): Source subaccount ID +- **destinationSubaccountId** (string): Destination subaccount ID +- **amount** (string): Margin amount to add + +Provide the request in the following JSON format: + +\`\`\`json +{ + "injectiveAddress": "inj1...", + "marketId": "0x...", + "sourceSubaccountId": "0x...", + "destinationSubaccountId": "0x...", + "amount": "1000000" +} +\`\`\` + +Response format: + +\`\`\`json +{ + "success": true, + "txHash": "0x..." +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const msgRewardsOptOutTemplate = ` +Extract the following details for opting out of rewards: +- **injectiveAddress** (string): Injective sender address + +Provide the request in the following JSON format: + +\`\`\`json +{ + "injectiveAddress": "inj1..." +} +\`\`\` + +Response format: + +\`\`\`json +{ + "success": true, + "txHash": "0x..." +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +// Admin Related Templates +export const msgAdminUpdateBinaryOptionsMarketTemplate = ` +Extract the following details for admin updating binary options market: +- **injectiveAddress** (string): Admin injective address +- **marketId** (string): Market ID +- **settlementPrice** (string): Settlement price +- **expiryTime** (number): Expiry timestamp +- **settlementTime** (number): Settlement timestamp + +Provide the request in the following JSON format: + +\`\`\`json +{ + "injectiveAddress": "inj1...", + "marketId": "0x...", + "settlementPrice": "25000.5", + "expiryTime": 1641859200, + "settlementTime": 1641945600 +} +\`\`\` + +Response format: + +\`\`\`json +{ + "success": true, + "txHash": "0x..." +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +// Module State & Parameters +export const getModuleStateTemplate = ` +Extract module state information. + +Response format: + +\`\`\`json +{ + "moduleState": { + "params": { + "spotMarketInstantListingFee": { + "amount": "100000000", + "denom": "inj" + }, + "derivativeMarketInstantListingFee": { + "amount": "1000000000", + "denom": "inj" + }, + "defaultSpotMakerFeeRate": "0.001", + "defaultSpotTakerFeeRate": "0.002", + "defaultDerivativeMakerFeeRate": "0.001", + "defaultDerivativeTakerFeeRate": "0.002", + "defaultInitialMarginRatio": "0.05", + "defaultMaintenanceMarginRatio": "0.02", + "defaultFundingInterval": 3600, + "fundingMultiple": 3600 + }, + "spotMarkets": [], + "derivativeMarkets": [], + "spotOrderbooks": [], + "derivativeOrderbooks": [], + "balances": [], + "positions": [] + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getFeeDiscountScheduleTemplate = ` +Extract fee discount schedule information. + +Response format: + +\`\`\`json +{ + "bucketCount": 10, + "bucketDuration": 1209600, + "quoteDenomsList": ["inj"], + "tierInfosList": [ + { + "makerDiscountRate": "0.001", + "takerDiscountRate": "0.001", + "stakedAmount": "10000000000", + "volume": "100000000" + } + ], + "disqualifiedMarketIdsList": [] +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getFeeDiscountAccountInfoTemplate = ` +Extract the following details for fee discount account info: +- **injAddress** (string): Injective address + +Provide the request in the following JSON format: + +\`\`\`json +{ + "injAddress": "inj1..." +} +\`\`\` + +Response format: + +\`\`\`json +{ + "tierLevel": 1, + "accountInfo": { + "makerDiscountRate": "0.001", + "takerDiscountRate": "0.001", + "stakedAmount": "10000000000", + "volume": "100000000" + }, + "accountTtl": { + "tier": 1, + "ttlTimestamp": 1641945600 + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +// Trading Rewards +export const getTradingRewardsCampaignTemplate = ` +Extract trading rewards campaign information. + +Response format: + +\`\`\`json +{ + "tradingRewardCampaignInfo": { + "campaignDurationSeconds": 604800, + "quoteDenomsList": ["inj"], + "tradingRewardBoostInfo": { + "boostedSpotMarketIdsList": [], + "spotMarketMultipliersList": [], + "boostedDerivativeMarketIdsList": [], + "derivativeMarketMultipliersList": [] + }, + "disqualifiedMarketIdsList": [] + }, + "tradingRewardPoolCampaignScheduleList": [ + { + "startTimestamp": 1641859200, + "maxCampaignRewardsList": [ + { + "amount": "1000000000", + "denom": "inj" + } + ] + } + ], + "totalTradeRewardPoints": "1000000", + "pendingTradingRewardPoolCampaignScheduleList": [], + "pendingTotalTradeRewardPointsList": [] +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getTradeRewardPointsTemplate = ` +Extract the following details for trade reward points: +- **injectiveAddresses** (string[]): List of Injective addresses + +Provide the request in the following JSON format: + +\`\`\`json +{ + "injectiveAddresses": ["inj1...", "inj2..."] +} +\`\`\` + +Response format: + +\`\`\`json +{ + "rewardPoints": ["100", "200"] +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getPendingTradeRewardPointsTemplate = ` +Extract the following details for pending trade reward points: +- **injectiveAddresses** (string[]): List of Injective addresses + +Provide the request in the following JSON format: + +\`\`\`json +{ + "injectiveAddresses": ["inj1...", "inj2..."] +} +\`\`\` + +Response format: + +\`\`\`json +{ + "rewardPoints": ["100", "200"] +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +// Binary Options Markets +export const msgCreateBinaryOptionsMarketTemplate = ` +Extract the following details for creating binary options market: +- **oracle** (string): Oracle provider +- **symbol** (string): Trading symbol +- **expiryTime** (number): Market expiry timestamp +- **settlementTime** (number): Settlement timestamp +- **admin** (string): Admin address +- **quoteDenom** (string): Quote denomination +- **minPriceTickSize** (string): Minimum price tick size +- **minQuantityTickSize** (string): Minimum quantity tick size + +Provide the request in the following JSON format: + +\`\`\`json +{ + "oracle": "band", + "symbol": "BTC/USD", + "expiryTime": 1641945600, + "settlementTime": 1641945600, + "admin": "inj1...", + "quoteDenom": "inj", + "minPriceTickSize": "0.000001", + "minQuantityTickSize": "0.000001" +} +\`\`\` + +Response format: + +\`\`\`json +{ + "marketId": "0x...", + "success": true, + "txHash": "0x..." +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +// Subaccount Trade Nonce +export const getSubaccountTradeNonceTemplate = ` +Extract the following details for subaccount trade nonce: +- **subaccountId** (string): Subaccount ID + +Provide the request in the following JSON format: + +\`\`\`json +{ + "subaccountId": "subaccount_id" +} +\`\`\` + +Response format: + +\`\`\`json +{ + "nonce": 5 +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +// Position History +export const getPositionsV2Template = ` +Extract the following details for positions V2 query: +- **address** (string, optional): Account address +- **marketId** (string, optional): Market ID +- **marketIds** (string[], optional): Multiple market IDs +- **subaccountId** (string, optional): Subaccount ID +- **direction** (string, optional): Position direction +- **pagination** (object, optional): Pagination options + +Provide the request in the following JSON format: + +\`\`\`json +{ + "address": "inj1...", + "marketId": "market_id", + "marketIds": ["market_id1", "market_id2"], + "subaccountId": "subaccount_id", + "direction": "long", + "pagination": { + "from": 1, + "to": 100, + "limit": 10 + } +} +\`\`\` + +Response format: + +\`\`\`json +{ + "positions": [ + { + "marketId": "market_id", + "subaccountId": "subaccount_id", + "direction": "long", + "quantity": "1.5", + "entryPrice": "25000.5", + "margin": "1000", + "liquidationPrice": "24000.0", + "markPrice": "25100.0", + "ticker": "BTC/USDT", + "aggregateReduceOnlyQuantity": "0", + "updatedAt": 1641859200 + } + ], + "pagination": { + "total": 100 + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +// Historical Data +export const getHistoricalBalanceTemplate = ` +Extract the following details for historical balance: +- **account** (string): Account address +- **resolution** (string): Time resolution for data points + +Provide the request in the following JSON format: + +\`\`\`json +{ + "account": "inj1...", + "resolution": "1d" +} +\`\`\` + +Response format: + +\`\`\`json +{ + "t": [1641859200, 1641945600], + "v": [1000.5, 1100.75] +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +// Denom Holders +export const getDenomHoldersTemplate = ` +Extract the following details for denom holders: +- **denom** (string): Token denomination +- **token** (string, optional): Token address +- **limit** (number, optional): Number of results + +Provide the request in the following JSON format: + +\`\`\`json +{ + "denom": "inj", + "token": "0x...", + "limit": 100 +} +\`\`\` + +Response format: + +\`\`\`json +{ + "holders": [ + { + "accountAddress": "inj1...", + "balance": "1000000" + } + ], + "next": ["next_key"] +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +// Grid Strategies +export const getGridStrategiesTemplate = ` +Extract the following details for grid strategies: +- **skip** (number, optional): Number of items to skip +- **limit** (number, optional): Number of items to return +- **state** (string, optional): Strategy state +- **marketId** (string, optional): Market ID +- **marketType** (string, optional): Market type +- **strategyType** (string[], optional): Strategy types +- **subaccountId** (string, optional): Subaccount ID +- **accountAddress** (string, optional): Account address + +Provide the request in the following JSON format: + +\`\`\`json +{ + "skip": 0, + "limit": 100, + "state": "active", + "marketId": "market_id", + "marketType": "spot", + "strategyType": ["uniform"], + "subaccountId": "subaccount_id", + "accountAddress": "inj1..." +} +\`\`\` + +Response format: + +\`\`\`json +{ + "strategies": [ + { + "id": "strategy_id", + "accountAddress": "inj1...", + "subaccountId": "subaccount_id", + "marketId": "market_id", + "strategyType": "uniform", + "tickSize": "0.1", + "minPrice": "24000.0", + "maxPrice": "26000.0", + "gridCount": 20, + "state": "active", + "totalVolume": "100000.5", + "currentPnL": "1000.25", + "createdAt": 1641859200, + "updatedAt": 1641945600 + } + ] +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +// Instant Market Launch +export const msgInstantSpotMarketLaunchTemplate = ` +Extract the following details for instant spot market launch: +- **ticker** (string): Market ticker +- **baseDenom** (string): Base denomination +- **quoteDenom** (string): Quote denomination +- **minPriceTickSize** (string): Minimum price tick size +- **minQuantityTickSize** (string): Minimum quantity tick size + +Provide the request in the following JSON format: + +\`\`\`json +{ + "ticker": "INJ/USDT", + "baseDenom": "inj", + "quoteDenom": "usdt", + "minPriceTickSize": "0.000001", + "minQuantityTickSize": "0.000001" +} +\`\`\` + +Response format: + +\`\`\`json +{ + "marketId": "0x...", + "success": true, + "txHash": "0x..." +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getModuleParamsTemplate = ` +Extract module parameters information. + +Response format: + +\`\`\`json +{ + "spotMarketInstantListingFee": { + "amount": "100000000", + "denom": "inj" + }, + "derivativeMarketInstantListingFee": { + "amount": "1000000000", + "denom": "inj" + }, + "defaultSpotMakerFeeRate": "0.001", + "defaultSpotTakerFeeRate": "0.002", + "defaultDerivativeMakerFeeRate": "0.001", + "defaultDerivativeTakerFeeRate": "0.002", + "defaultInitialMarginRatio": "0.05", + "defaultMaintenanceMarginRatio": "0.02", + "defaultFundingInterval": 3600, + "fundingMultiple": 3600, + "relayerFeeShareRate": "0.4", + "exchangeModuleAdmin": "inj1..." +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getOrderStatesTemplate = ` +Extract the following details for order states: +- **spotOrderHashes** (string[], optional): Spot order hashes +- **derivativeOrderHashes** (string[], optional): Derivative order hashes + +Provide the request in the following JSON format: + +\`\`\`json +{ + "spotOrderHashes": ["0x..."], + "derivativeOrderHashes": ["0x..."] +} +\`\`\` + +Response format: + +\`\`\`json +{ + "spotOrderStates": { + "orderHash": "OrderState" + }, + "derivativeOrderStates": { + "orderHash": "OrderState" + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getSubaccountOrderSummaryTemplate = ` +Extract the following details for subaccount order summary: +- **subaccountId** (string): Subaccount ID +- **marketId** (string, optional): Market ID filter +- **orderDirection** (string, optional): Order direction filter + +Provide the request in the following JSON format: + +\`\`\`json +{ + "subaccountId": "0x...", + "marketId": "0x...", + "orderDirection": "buy" +} +\`\`\` + +Response format: + +\`\`\`json +{ + "spotOrdersTotal": "10", + "derivativeOrdersTotal": "5", + "spotOrdersActiveTotal": "3", + "derivativeOrdersActiveTotal": "2", + "spotOrdersCancelledTotal": "5", + "derivativeOrdersCancelledTotal": "2", + "spotOrdersFilledTotal": "2", + "derivativeOrdersFilledTotal": "1" +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getDerivativeMarketsTemplate = ` +Extract the following details for derivative markets: +- **quoteDenom** (string, optional): Quote denomination filter, this needs to be in denom format! +- **marketStatus** (string, optional): Market status filter +- **marketStatuses** (string[], optional): Multiple market status filter + +Provide the request in the following JSON format: + +\`\`\`json +{ + "quoteDenom": "peggy0xdAC17F958D2ee523a2206206994597C13D831ec7", + "marketStatus": "active", + "marketStatuses": ["active", "paused"] +} +\`\`\` + +Response format: + +\`\`\`json +{ + "markets": [ + { + "marketId": "0x...", + "marketStatus": "active", + "ticker": "BTC/USDT PERP", + "oracleBase": "BTC", + "oracleQuote": "USDT", + "quoteDenom": "usdt", + "makerFeeRate": "0.001", + "takerFeeRate": "0.002", + "serviceProviderFee": "0.4", + "isPerpetual": true, + "minPriceTickSize": 0.01, + "minQuantityTickSize": 0.001 + } + ] +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getSpotMarketsTemplate = ` +Extract the following details for spot markets: +- **baseDenom** (string, optional): Base denomination filter +- **quoteDenom** (string, optional): Quote denomination filter +- **marketStatus** (string, optional): Market status filter +- **marketStatuses** (string[], optional): Multiple market status filter + +Provide the request in the following JSON format: + +\`\`\`json +{ + "baseDenom": "inj", + "quoteDenom": "peggy0xdAC17F958D2ee523a2206206994597C13D831ec7", + "marketStatus": "active", + "marketStatuses": ["active", "paused"] +} +\`\`\` + +Response format: + +\`\`\`json +{ + "markets": [ + { + "marketId": "0x...", + "marketStatus": "active", + "ticker": "INJ/USDT", + "baseDenom": "inj", + "quoteDenom": "usdt", + "makerFeeRate": "0.001", + "takerFeeRate": "0.002", + "serviceProviderFee": "0.4", + "minPriceTickSize": 0.000001, + "minQuantityTickSize": 0.000001 + } + ] +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getSubaccountsListTemplate = ` +Extract the following details for subaccounts list: +- **address** (string): Account address + +Provide the request in the following JSON format: + +\`\`\`json +{ + "address": "inj1..." +} +\`\`\` + +Response format: + +\`\`\`json +{ + "subaccounts": ["0x..."] +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getSubaccountBalancesListTemplate = ` +Extract the following details for subaccount balances: +- **subaccountId** (string): Subaccount ID + +Provide the request in the following JSON format: + +\`\`\`json +{ + "subaccountId": "0x..." +} +\`\`\` + +Response format: + +\`\`\`json +{ + "balances": [ + { + "subaccountId": "0x...", + "accountAddress": "inj1...", + "denom": "inj", + "deposit": { + "totalBalance": "1000000", + "availableBalance": "900000" + } + } + ] +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getOrderbooksV2Template = ` +Extract the following details for orderbooks V2: +- **marketIds** (string[]): List of market IDs + +Provide the request in the following JSON format: + +\`\`\`json +{ + "marketIds": ["0x..."] +} +\`\`\` + +Response format: + +\`\`\`json +{ + "orderbooks": [ + { + "marketId": "0x...", + "orderbook": { + "sequence": "123", + "buys": [ + { + "price": "25000.5", + "quantity": "1.5", + "timestamp": 1641859200 + } + ], + "sells": [ + { + "price": "25100.5", + "quantity": "0.5", + "timestamp": 1641859200 + } + ] + } + } + ] +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getTradingRewardsTemplate = ` +Extract the following details for trading rewards: +- **address** (string): Account address +- **epoch** (number): Reward epoch + +Provide the request in the following JSON format: + +\`\`\`json +{ + "address": "inj1...", + "epoch": 1 +} +\`\`\` + +Response format: + +\`\`\`json +{ + "rewards": [ + { + "accountAddress": "inj1...", + "rewards": [ + { + "amount": "1000000", + "denom": "inj" + } + ], + "distributedAt": 1641859200 + } + ] +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getHistoricalRpnlTemplate = ` +Extract the following details for historical RPNL: +- **account** (string): Account address +- **resolution** (string): Time resolution for data points + +Provide the request in the following JSON format: + +\`\`\`json +{ + "account": "inj1...", + "resolution": "1d" +} +\`\`\` + +Response format: + +\`\`\`json +{ + "t": [1641859200, 1641945600], + "v": [1000.5, 1100.75] +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getHistoricalVolumesTemplate = ` +Extract the following details for historical volumes: +- **account** (string): Account address +- **resolution** (string): Time resolution for data points + +Provide the request in the following JSON format: + +\`\`\`json +{ + "account": "inj1...", + "resolution": "1d" +} +\`\`\` + +Response format: + +\`\`\`json +{ + "t": [1641859200, 1641945600], + "v": [50000.5, 75000.25] +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getFundingPaymentsTemplate = ` +Extract the following details for funding payments: +- **marketId** (string, optional): Market ID filter +- **marketIds** (string[], optional): Multiple market IDs filter +- **subaccountId** (string, optional): Subaccount ID filter +- **pagination** (object, optional): Pagination options + +Provide the request in the following JSON format: + +\`\`\`json +{ + "marketId": "0x...", + "marketIds": ["0x..."], + "subaccountId": "0x...", + "pagination": { + "from": 1, + "to": 100, + "limit": 10 + } +} +\`\`\` + +Response format: + +\`\`\`json +{ + "fundingPayments": [ + { + "marketId": "0x...", + "subaccountId": "0x...", + "amount": "100.5", + "timestamp": 1641859200 + } + ], + "pagination": { + "total": 100 + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getPnlLeaderboardTemplate = ` +Extract the following details for PnL leaderboard: +- **startDate** (string): Start date +- **endDate** (string): End date +- **limit** (number, optional): Number of results +- **account** (string, optional): Account address filter + +Provide the request in the following JSON format: + +\`\`\`json +{ + "startDate": "2024-01-01", + "endDate": "2024-01-31", + "limit": 100, + "account": "inj1..." +} +\`\`\` + +Response format: + +\`\`\`json +{ + "firstDate": "2024-01-01", + "lastDate": "2024-01-31", + "leaders": [ + { + "account": "inj1...", + "pnl": 100000.5, + "volume": 1000000.0, + "rank": 1 + } + ], + "accountRow": { + "account": "inj1...", + "pnl": 50000.25, + "volume": 500000.0, + "rank": 10 + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getVolLeaderboardTemplate = ` +Extract the following details for volume leaderboard: +- **startDate** (string): Start date +- **endDate** (string): End date +- **limit** (number, optional): Number of results +- **account** (string, optional): Account address filter + +Provide the request in the following JSON format: + +\`\`\`json +{ + "startDate": "2024-01-01", + "endDate": "2024-01-31", + "limit": 100, + "account": "inj1..." +} +\`\`\` + +Response format: + +\`\`\`json +{ + "firstDate": "2024-01-01", + "lastDate": "2024-01-31", + "leaders": [ + { + "account": "inj1...", + "volume": 1000000.0, + "rank": 1 + } + ], + "accountRow": { + "account": "inj1...", + "volume": 500000.0, + "rank": 10 + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getPnlLeaderboardFixedResolutionTemplate = ` +Extract the following details for PnL leaderboard with fixed resolution: +- **resolution** (string): Time resolution +- **limit** (number, optional): Number of results +- **account** (string, optional): Account address filter + +Provide the request in the following JSON format: + +\`\`\`json +{ + "resolution": "1d", + "limit": 100, + "account": "inj1..." +} +\`\`\` + +Response format: + +\`\`\`json +{ + "firstDate": "2024-01-01", + "lastDate": "2024-01-31", + "leaders": [ + { + "account": "inj1...", + "pnl": 100000.5, + "volume": 1000000.0, + "rank": 1 + } + ], + "accountRow": { + "account": "inj1...", + "pnl": 50000.25, + "volume": 500000.0, + "rank": 10 + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getVolLeaderboardFixedResolutionTemplate = ` +Extract the following details for volume leaderboard with fixed resolution: +- **resolution** (string): Time resolution +- **limit** (number, optional): Number of results +- **account** (string, optional): Account address filter + +Provide the request in the following JSON format: + +\`\`\`json +{ + "resolution": "1d", + "limit": 100, + "account": "inj1..." +} +\`\`\` + +Response format: + +\`\`\`json +{ + "firstDate": "2024-01-01", + "lastDate": "2024-01-31", + "leaders": [ + { + "account": "inj1...", + "volume": 1000000.0, + "rank": 1 + } + ], + "accountRow": { + "account": "inj1...", + "volume": 500000.0, + "rank": 10 + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getAtomicSwapHistoryTemplate = ` +Extract the following details for atomic swap history: +- **address** (string): Account address +- **contractAddress** (string): Contract address +- **pagination** (object, optional): Pagination options + +Provide the request in the following JSON format: + +\`\`\`json +{ + "address": "inj1...", + "contractAddress": "0x...", + "pagination": { + "from": 1, + "to": 100, + "limit": 10 + } +} +\`\`\` + +Response format: + +\`\`\`json +{ + "swapHistory": [ + { + "sender": "inj1...", + "route": "route_id", + "sourceCoin": { + "amount": "1000000", + "denom": "inj" + }, + "destinationCoin": { + "amount": "900000", + "denom": "usdt" + }, + "fees": [ + { + "amount": "1000", + "denom": "inj" + } + ], + "contractAddress": "0x...", + "indexBySender": 1, + "indexBySenderContract": 1, + "txHash": "0x...", + "executedAt": 1641859200 + } + ], + "pagination": { + "total": 100 + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getIsOptedOutOfRewardsTemplate = ` +Extract the following details for rewards opt-out status: +- **account** (string): Account address + +Provide the request in the following JSON format: + +\`\`\`json +{ + "account": "inj1..." +} +\`\`\` + +Response format: + +\`\`\`json +{ + "isOptedOut": true +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getBinaryOptionsMarketsTemplate = ` +Extract the following details for binary options markets: +- **marketStatus** (string, optional): Market status filter +- **quoteDenom** (string, optional): Quote denomination filter +- **pagination** (object, optional): Pagination options + +Provide the request in the following JSON format: + +\`\`\`json +{ + "marketStatus": "active", + "quoteDenom": "usdt", + "pagination": { + "from": 1, + "to": 100, + "limit": 10 + } +} +\`\`\` + +Response format: + +\`\`\`json +{ + "markets": [ + { + "marketId": "0x...", + "marketStatus": "active", + "ticker": "BTC>25000-240630", + "oracleSymbol": "BTC", + "oracleProvider": "band", + "oracleScaleFactor": 6, + "quoteDenom": "usdt", + "makerFeeRate": "0.001", + "takerFeeRate": "0.002", + "expirationTimestamp": 1719705600, + "settlementTimestamp": 1719792000, + "serviceProviderFee": "0.4", + "minPriceTickSize": 0.01, + "minQuantityTickSize": 0.001 + } + ], + "pagination": { + "total": 100 + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getBinaryOptionsMarketTemplate = ` +Extract the following details for binary options market lookup: +- **marketId** (string): Market ID + +Provide the request in the following JSON format: + +\`\`\`json +{ + "marketId": "0x..." +} +\`\`\` + +Response format: + +\`\`\`json +{ + "market": { + "marketId": "0x...", + "marketStatus": "active", + "ticker": "BTC>25000-240630", + "oracleSymbol": "BTC", + "oracleProvider": "band", + "oracleScaleFactor": 6, + "quoteDenom": "usdt", + "makerFeeRate": "0.001", + "takerFeeRate": "0.002", + "expirationTimestamp": 1719705600, + "settlementTimestamp": 1719792000, + "serviceProviderFee": "0.4", + "minPriceTickSize": 0.01, + "minQuantityTickSize": 0.001 + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getDerivativeOrderHistoryTemplate = ` +Extract the following details for derivative order history: +- **subaccountId** (string, optional): Subaccount ID filter +- **marketId** (string, optional): Market ID filter +- **marketIds** (string[], optional): Multiple market IDs filter +- **orderTypes** (string[], optional): Order types filter +- **executionTypes** (string[], optional): Execution types filter +- **direction** (string, optional): Order direction filter +- **isConditional** (boolean, optional): Whether order is conditional +- **state** (string, optional): Order state filter +- **pagination** (object, optional): Pagination options + +Provide the request in the following JSON format: + +\`\`\`json +{ + "subaccountId": "0x...", + "marketId": "0x...", + "marketIds": ["0x..."], + "orderTypes": ["limit", "market"], + "executionTypes": ["limit", "market"], + "direction": "buy", + "isConditional": false, + "state": "booked", + "pagination": { + "from": 1, + "to": 100, + "limit": 10 + } +} +\`\`\` + +Response format: + +\`\`\`json +{ + "orderHistory": [ + { + "orderHash": "0x...", + "marketId": "0x...", + "isActive": true, + "subaccountId": "0x...", + "executionType": "limit", + "orderType": "buy", + "price": "25000.5", + "triggerPrice": "0", + "quantity": "1.5", + "filledQuantity": "0.5", + "state": "booked", + "createdAt": 1641859200, + "updatedAt": 1641859200, + "direction": "buy", + "isConditional": false, + "triggerAt": 0, + "margin": "1000" + } + ], + "pagination": { + "total": 100 + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getPositionsListTemplate = ` +Extract the following details for positions list: +- **marketId** (string, optional): Market ID filter +- **marketIds** (string[], optional): Multiple market IDs filter +- **subaccountId** (string, optional): Subaccount ID filter +- **direction** (string, optional): Position direction filter +- **pagination** (object, optional): Pagination options + +Provide the request in the following JSON format: + +\`\`\`json +{ + "marketId": "0x...", + "marketIds": ["0x..."], + "subaccountId": "0x...", + "direction": "long", + "pagination": { + "from": 1, + "to": 100, + "limit": 10 + } +} +\`\`\` + +Response format: + +\`\`\`json +{ + "positions": [ + { + "marketId": "0x...", + "subaccountId": "0x...", + "direction": "long", + "quantity": "1.5", + "entryPrice": "25000.5", + "margin": "1000", + "liquidationPrice": "24000.0", + "markPrice": "25100.0", + "ticker": "BTC/USDT" + } + ], + "pagination": { + "total": 100 + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getDerivativeTradesTemplate = ` +Extract the following details for derivative trades: +- **marketId** (string, optional): Market ID filter +- **marketIds** (string[], optional): Multiple market IDs filter +- **subaccountId** (string, optional): Subaccount ID filter +- **executionSide** (string, optional): Execution side filter +- **direction** (string, optional): Trade direction filter +- **executionTypes** (string[], optional): Execution types filter +- **pagination** (object, optional): Pagination options + +Provide the request in the following JSON format: + +\`\`\`json +{ + "marketId": "0x...", + "marketIds": ["0x..."], + "subaccountId": "0x...", + "executionSide": "taker", + "direction": "buy", + "executionTypes": ["market", "limit"], + "pagination": { + "from": 1, + "to": 100, + "limit": 10 + } +} +\`\`\` + +Response format: + +\`\`\`json +{ + "trades": [ + { + "orderHash": "0x...", + "subaccountId": "0x...", + "marketId": "0x...", + "tradeId": "trade_id", + "executedAt": 1641859200, + "tradeExecutionType": "market", + "executionSide": "taker", + "tradeDirection": "buy", + "executionPrice": "25000.5", + "executionQuantity": "1.5", + "executionMargin": "1000", + "fee": "25.0", + "feeRecipient": "inj1...", + "isLiquidation": false, + "payout": "37525.75" + } + ], + "pagination": { + "total": 100 + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getDerivativeSubaccountOrdersListTemplate = ` +Extract the following details for derivative subaccount orders: +- **subaccountId** (string): Subaccount ID +- **marketId** (string, optional): Market ID filter +- **pagination** (object, optional): Pagination options + +Provide the request in the following JSON format: + +\`\`\`json +{ + "subaccountId": "0x...", + "marketId": "0x...", + "pagination": { + "from": 1, + "to": 100, + "limit": 10 + } +} +\`\`\` + +Response format: + +\`\`\`json +{ + "orders": [ + { + "orderHash": "0x...", + "orderSide": "buy", + "marketId": "0x...", + "subaccountId": "0x...", + "isReduceOnly": false, + "margin": "1000", + "price": "25000.5", + "quantity": "1.5", + "unfilledQuantity": "0.5", + "triggerPrice": "0", + "feeRecipient": "inj1...", + "state": "booked", + "createdAt": 1641859200, + "updatedAt": 1641859200, + "orderNumber": 1, + "orderType": "limit", + "isConditional": false, + "triggerAt": 0, + "placedOrderHash": "0x...", + "executionType": "limit" + } + ], + "pagination": { + "total": 100 + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getOrderbookTemplate = ` +Extract the following details for orderbooks: +- **marketIds** (string[]): Market IDs + +Provide the request in the following JSON format: + +\`\`\`json +{ + "marketIds": ["0x..."] +} +\`\`\` + +Response format: + +\`\`\`json +{ + "orderbook": [ + "marketId": "0x...", + "orderbook": { + "sequence": "123", + "buys": [ + { + "price": "25000.5", + "quantity": "1.5", + "timestamp": 1641859200 + } + ], + "sells": [ + { + "price": "25100.5", + "quantity": "0.5", + "timestamp": 1641859200 + } + ] + } + ] +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const msgBatchCancelBinaryOptionsOrdersTemplate = ` +Extract the following details for batch canceling binary options orders: +- **injectiveAddress** (string): Injective sender address +- **orders** (array): List of orders to cancel containing: + - marketId (string) + - subaccountId (string) + - orderHash (string) + +Provide the request in the following JSON format: + +\`\`\`json +{ + "injectiveAddress": "inj1...", + "orders": [ + { + "marketId": "0x...", + "subaccountId": "0x...", + "orderHash": "0x..." + } + ] +} +\`\`\` + +Response format: + +\`\`\`json +{ + "success": true, + "txHash": "0x..." +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const msgCancelBinaryOptionsOrderTemplate = ` +Extract the following details for canceling a binary options order: +- **injectiveAddress** (string): Injective sender address +- **marketId** (string): Market ID +- **subaccountId** (string): Subaccount ID +- **orderHash** (string): Order hash + +Provide the request in the following JSON format: + +\`\`\`json +{ + "injectiveAddress": "inj1...", + "marketId": "0x...", + "subaccountId": "0x...", + "orderHash": "0x..." +} +\`\`\` + +Response format: + +\`\`\`json +{ + "success": true, + "txHash": "0x..." +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const msgCreateBinaryOptionsLimitOrderTemplate = ` +Extract the following details for creating binary options limit order: +- **injectiveAddress** (string): Injective sender address +- **marketId** (string): Market ID +- **subaccountId** (string): Subaccount ID +- **feeRecipient** (string): Fee recipient address +- **price** (string): Order price +- **quantity** (string): Order quantity +- **orderType** (string): Order type (BUY/SELL) + +Provide the request in the following JSON format: + +\`\`\`json +{ + "injectiveAddress": "inj1...", + "marketId": "0x...", + "subaccountId": "0x...", + "feeRecipient": "inj1...", + "price": "25000.5", + "quantity": "1.5", + "orderType": "BUY" +} +\`\`\` + +Response format: + +\`\`\`json +{ + "orderHash": "0x...", + "txHash": "0x..." +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const msgLiquidatePositionTemplate = ` +Extract the following details for liquidating a position: +- **injectiveAddress** (string): Injective sender address +- **subaccountId** (string): Subaccount ID to liquidate +- **marketId** (string): Market ID +- **order** (object): Liquidation order details containing: + - marketId (string) + - orderType (string) + - price (string) + - quantity (string) + - margin (string) + +Provide the request in the following JSON format: + +\`\`\`json +{ + "injectiveAddress": "inj1...", + "subaccountId": "0x...", + "marketId": "0x...", + "order": { + "marketId": "0x...", + "orderType": "SELL", + "price": "24000.0", + "quantity": "1.5", + "margin": "1000" + } +} +\`\`\` + +Response format: + +\`\`\`json +{ + "success": true, + "txHash": "0x..." +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const msgReclaimLockedFundsTemplate = ` +Extract the following details for reclaiming locked funds: +- **injectiveAddress** (string): Injective sender address +- **lockedAccountPubKey** (string): Public key of the locked account +- **lockedAccountSignature** (string): Signature from the locked account + +Provide the request in the following JSON format: + +\`\`\`json +{ + "injectiveAddress": "inj1...", + "lockedAccountPubKey": "0x...", + "lockedAccountSignature": "0x..." +} +\`\`\` + +Response format: + +\`\`\`json +{ + "success": true, + "txHash": "0x..." +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const msgSignDataTemplate = ` +Extract the following details for signing data: +- **injectiveAddress** (string): Injective sender address +- **data** (string): Data to sign + +Provide the request in the following JSON format: + +\`\`\`json +{ + "injectiveAddress": "inj1...", + "data": "0x..." +} +\`\`\` + +Response format: + +\`\`\`json +{ + "signature": "0x...", + "success": true, + "txHash": "0x..." +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const msgCreateSpotLimitOrderTemplate = ` +Extract the following details for creating spot limit order: +- **injectiveAddress** (string): Injective sender address +- **marketId** (string): Market ID +- **subaccountId** (string): Subaccount ID +- **orderType** (string): Order type (BUY/SELL) +- **price** (string): Order price +- **quantity** (string): Order quantity +- **feeRecipient** (string): Fee recipient address + +Provide the request in the following JSON format: + +\`\`\`json +{ + "injectiveAddress": "inj1...", + "marketId": "0x...", + "subaccountId": "0x...", + "orderType": "BUY", + "price": "25000.5", + "quantity": "1.5", + "feeRecipient": "inj1..." +} +\`\`\` + +Response format: + +\`\`\`json +{ + "orderHash": "0x...", + "txHash": "0x..." +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const msgCreateDerivativeLimitOrderTemplate = ` +Extract the following details for creating derivative limit order: +- **injectiveAddress** (string): Injective sender address +- **marketId** (string): Market ID +- **subaccountId** (string): Subaccount ID +- **orderType** (string): Order type (BUY/SELL) +- **price** (string): Order price +- **quantity** (string): Order quantity +- **margin** (string): Order margin +- **feeRecipient** (string): Fee recipient address + +Provide the request in the following JSON format: + +\`\`\`json +{ + "injectiveAddress": "inj1...", + "marketId": "0x...", + "subaccountId": "0x...", + "orderType": "BUY", + "price": "25000.5", + "quantity": "1.5", + "margin": "1000", + "feeRecipient": "inj1..." +} +\`\`\` + +Response format: + +\`\`\`json +{ + "orderHash": "0x...", + "txHash": "0x..." +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const msgBatchCancelSpotOrdersTemplate = ` +Extract the following details for batch canceling spot orders: +- **injectiveAddress** (string): Injective sender address +- **orders** (array): List of orders to cancel containing: + - marketId (string) + - subaccountId (string) + - orderHash (string) + +Provide the request in the following JSON format: + +\`\`\`json +{ + "injectiveAddress": "inj1...", + "orders": [ + { + "marketId": "0x...", + "subaccountId": "0x...", + "orderHash": "0x..." + } + ] +} +\`\`\` + +Response format: + +\`\`\`json +{ + "success": true, + "txHash": "0x..." +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const msgBatchCancelDerivativeOrdersTemplate = ` +Extract the following details for batch canceling derivative orders: +- **injectiveAddress** (string): Injective sender address +- **orders** (array): List of orders to cancel containing: + - marketId (string) + - subaccountId (string) + - orderHash (string) + +Provide the request in the following JSON format: + +\`\`\`json +{ + "injectiveAddress": "inj1...", + "orders": [ + { + "marketId": "0x...", + "subaccountId": "0x...", + "orderHash": "0x..." + } + ] +} +\`\`\` + +Response format: + +\`\`\`json +{ + "success": true, + "txHash": "0x..." +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const msgCancelSpotOrderTemplate = ` +Extract the following details for canceling a spot order: +- **injectiveAddress** (string): Injective sender address +- **marketId** (string): Market ID +- **subaccountId** (string): Subaccount ID +- **orderHash** (string): Order hash + +Provide the request in the following JSON format: + +\`\`\`json +{ + "injectiveAddress": "inj1...", + "marketId": "0x...", + "subaccountId": "0x...", + "orderHash": "0x..." +} +\`\`\` + +Response format: + +\`\`\`json +{ + "success": true, + "txHash": "0x..." +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const msgCancelDerivativeOrderTemplate = ` +Extract the following details for canceling a derivative order: +- **injectiveAddress** (string): Injective sender address +- **marketId** (string): Market ID +- **subaccountId** (string): Subaccount ID +- **orderHash** (string): Order hash + +Provide the request in the following JSON format: + +\`\`\`json +{ + "injectiveAddress": "inj1...", + "marketId": "0x...", + "subaccountId": "0x...", + "orderHash": "0x..." +} +\`\`\` + +Response format: + +\`\`\`json +{ + "success": true, + "txHash": "0x..." +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getSpotSubaccountOrdersListTemplate = ` +Extract the following details for spot subaccount orders: +- **subaccountId** (string): Subaccount ID +- **marketId** (string, optional): Market ID filter +- **pagination** (object, optional): Pagination options + +Provide the request in the following JSON format: + +\`\`\`json +{ + "subaccountId": "0x...", + "marketId": "0x...", + "pagination": { + "from": 1, + "to": 100, + "limit": 10 + } +} +\`\`\` + +Response format: + +\`\`\`json +{ + "orders": [ + { + "orderHash": "0x...", + "orderSide": "buy", + "marketId": "0x...", + "subaccountId": "0x...", + "price": "25000.5", + "quantity": "1.5", + "unfilledQuantity": "0.5", + "triggerPrice": "0", + "feeRecipient": "inj1...", + "state": "booked", + "createdAt": 1641859200, + "updatedAt": 1641859200 + } + ], + "pagination": { + "total": 100 + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getSpotSubaccountTradesListTemplate = ` +Extract the following details for spot subaccount trades: +- **subaccountId** (string): Subaccount ID +- **marketId** (string, optional): Market ID filter +- **direction** (string, optional): Trade direction +- **executionType** (string, optional): Execution type +- **pagination** (object, optional): Pagination options + +Provide the request in the following JSON format: + +\`\`\`json +{ + "subaccountId": "0x...", + "marketId": "0x...", + "direction": "buy", + "executionType": "market", + "pagination": { + "from": 1, + "to": 100, + "limit": 10 + } +} +\`\`\` + +Response format: + +\`\`\`json +{ + "trades": [ + { + "orderHash": "0x...", + "subaccountId": "0x...", + "marketId": "0x...", + "tradeId": "trade_id", + "executedAt": 1641859200, + "executionSide": "taker", + "tradeExecutionType": "market", + "tradeDirection": "buy", + "executionPrice": "25000.5", + "executionQuantity": "1.5", + "fee": "25.0", + "feeRecipient": "inj1..." + } + ], + "pagination": { + "total": 100 + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const msgCreateBinaryOptionsMarketOrderTemplate = ` +Extract the following details for creating binary options market order: +- **injectiveAddress** (string): Injective sender address +- **marketId** (string): Market ID +- **subaccountId** (string): Subaccount ID +- **feeRecipient** (string): Fee recipient address +- **price** (string): Order price +- **quantity** (string): Order quantity +- **orderType** (string): Order type (BUY/SELL) + +Provide the request in the following JSON format: + +\`\`\`json +{ + "injectiveAddress": "inj1...", + "marketId": "0x...", + "subaccountId": "0x...", + "feeRecipient": "inj1...", + "price": "25000.5", + "quantity": "1.5", + "orderType": "BUY" +} +\`\`\` + +Response format: + +\`\`\`json +{ + "orderHash": "0x...", + "txHash": "0x..." +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getSpotOrderHistoryTemplate = ` +Extract the following details for spot order history: +- **subaccountId** (string, optional): Subaccount ID filter +- **marketId** (string, optional): Market ID filter +- **marketIds** (string[], optional): Multiple market IDs filter +- **orderTypes** (string[], optional): Order types filter +- **executionTypes** (string[], optional): Execution types filter +- **direction** (string, optional): Order direction filter +- **isConditional** (boolean, optional): Whether order is conditional +- **state** (string, optional): Order state filter +- **pagination** (object, optional): Pagination options + +Provide the request in the following JSON format: + +\`\`\`json +{ + "subaccountId": "0x...", + "marketId": "0x...", + "marketIds": ["0x..."], + "orderTypes": ["limit", "market"], + "executionTypes": ["limit", "market"], + "direction": "buy", + "isConditional": false, + "state": "booked", + "pagination": { + "from": 1, + "to": 100, + "limit": 10 + } +} +\`\`\` + +Response format: + +\`\`\`json +{ + "orderHistory": [ + { + "orderHash": "0x...", + "marketId": "0x...", + "active": true, + "subaccountId": "0x...", + "executionType": "limit", + "orderType": "buy", + "price": "25000.5", + "triggerPrice": "0", + "quantity": "1.5", + "filledQuantity": "0.5", + "state": "booked", + "createdAt": 1641859200, + "updatedAt": 1641859200, + "direction": "buy" + } + ], + "pagination": { + "total": 100 + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getSpotTradesTemplate = ` +Extract the following details for spot trades: +- **marketId** (string, optional): Market ID filter +- **marketIds** (string[], optional): Multiple market IDs filter +- **subaccountId** (string, optional): Subaccount ID filter +- **executionSide** (string, optional): Execution side filter +- **direction** (string, optional): Trade direction filter +- **executionTypes** (string[], optional): Execution types filter +- **pagination** (object, optional): Pagination options + +Provide the request in the following JSON format: + +\`\`\`json +{ + "marketId": "0x...", + "marketIds": ["0x..."], + "subaccountId": "0x...", + "executionSide": "taker", + "direction": "buy", + "executionTypes": ["market", "limit"], + "pagination": { + "from": 1, + "to": 100, + "limit": 10 + } +} +\`\`\` + +Response format: + +\`\`\`json +{ + "trades": [ + { + "orderHash": "0x...", + "subaccountId": "0x...", + "marketId": "0x...", + "tradeId": "trade_id", + "executedAt": 1641859200, + "executionSide": "taker", + "tradeExecutionType": "market", + "tradeDirection": "buy", + "price": "25000.5", + "quantity": "1.5", + "fee": "25.0", + "feeRecipient": "inj1..." + } + ], + "pagination": { + "total": 100 + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getAccountPortfolioBalancesTemplate = ` +Extract the following details for account portfolio balances: +- **address** (string): Account address + +Provide the request in the following JSON format: + +\`\`\`json +{ + "address": "inj1..." +} +\`\`\` + +Response format: + +\`\`\`json +{ + "balances": [ + { + "denom": "inj", + "totalBalance": "1000000", + "availableBalance": "900000", + "lockedBalance": "100000" + } + ], + "subaccountBalances": [ + { + "subaccountId": "0x...", + "denom": "inj", + "deposit": { + "totalBalance": "1000000", + "availableBalance": "900000" + } + } + ] +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getRewardsTemplate = ` +Extract the following details for rewards: +- **address** (string): Account address +- **epoch** (number): Reward epoch + +Provide the request in the following JSON format: + +\`\`\`json +{ + "address": "inj1...", + "epoch": 1 +} +\`\`\` + +Response format: + +\`\`\`json +{ + "rewards": [ + { + "accountAddress": "inj1...", + "rewards": [ + { + "amount": "1000000", + "denom": "inj" + } + ], + "distributedAt": 1641859200 + } + ] +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/template/explorer.ts b/packages/plugin-injective/injective-sdk-client-ts/src/template/explorer.ts new file mode 100644 index 00000000000..f4f4606a243 --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/template/explorer.ts @@ -0,0 +1,450 @@ +export const getTxByHashTemplate = ` +Extract the following details for transaction lookup: +- **hash** (string): Transaction hash to lookup + +Provide the request in the following JSON format: + +\`\`\`json +{ + "hash": "0x..." +} +\`\`\` + +Response format: + +\`\`\`json +{ + "id": "tx_id", + "blockNumber": 12345, + "blockTimestamp": "2024-01-11T12:00:00Z", + "hash": "0x...", + "memo": "transaction memo", + "code": 0, + "data": "base64_encoded_data", + "info": "transaction info", + "gasWanted": 100000, + "gasUsed": 80000, + "gasFee": { + "amounts": [ + { + "amount": "1000000", + "denom": "inj" + } + ], + "gasLimit": 100000, + "payer": "inj1...", + "granter": "inj1..." + }, + "txType": "MsgSend", + "signatures": [ + { + "pubkey": "public_key", + "address": "inj1...", + "signature": "sig_data", + "sequence": 5 + } + ], + "messages": [ + { + "key": "message_key", + "value": "message_value" + } + ] +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getAccountTxTemplate = ` +Extract the following details for account transactions: +- **address** (string): Account address +- **limit** (number, optional): Number of results +- **type** (string, optional): Transaction type filter +- **before** (number, optional): Results before this block +- **after** (number, optional): Results after this block +- **startTime** (number, optional): Start timestamp +- **endTime** (number, optional): End timestamp + +Provide the request in the following JSON format: + +\`\`\`json +{ + "address": "inj1...", + "limit": 10, + "type": "MsgSend", + "before": 12345, + "after": 12300, + "startTime": 1641859200, + "endTime": 1641945600 +} +\`\`\` + +Response format: + +\`\`\`json +{ + "txs": [ + { + "id": "tx_id", + "blockNumber": 12345, + "blockTimestamp": "2024-01-11T12:00:00Z", + "hash": "0x...", + "txType": "MsgSend" + } + ], + "pagination": { + "total": 100 + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getValidatorTemplate = ` +Extract the following details for validator lookup: +- **address** (string): Validator address + +Provide the request in the following JSON format: + +\`\`\`json +{ + "address": "injvaloper1..." +} +\`\`\` + +Response format: + +\`\`\`json +{ + "id": "validator_id", + "moniker": "Validator Name", + "operatorAddress": "injvaloper1...", + "consensusAddress": "injvalcons1...", + "jailed": false, + "status": 1, + "tokens": "1000000000", + "delegatorShares": "1000000000", + "description": { + "moniker": "Validator Name", + "identity": "keybase_id", + "website": "https://validator.com", + "securityContact": "security@validator.com", + "details": "Validator details" + }, + "uptimePercentage": 99.9, + "commissionRate": "0.1", + "commissionMaxRate": "0.2", + "commissionMaxChangeRate": "0.01" +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getValidatorUptimeTemplate = ` +Extract the following details for validator uptime: +- **validatorAddress** (string): Validator address + +Provide the request in the following JSON format: + +\`\`\`json +{ + "validatorAddress": "injvaloper1..." +} +\`\`\` + +Response format: + +\`\`\`json +[ + { + "blockNumber": 12345, + "status": "signed" + } +] +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getPeggyDepositTxsTemplate = ` +Extract the following details for Peggy deposit transactions: +- **sender** (string, optional): Sender address +- **receiver** (string, optional): Receiver address +- **limit** (number, optional): Number of results +- **skip** (number, optional): Number of results to skip + +Provide the request in the following JSON format: + +\`\`\`json +{ + "sender": "eth_address", + "receiver": "inj1...", + "limit": 10, + "skip": 0 +} +\`\`\` + +Response format: + +\`\`\`json +[ + { + "sender": "eth_address", + "receiver": "inj1...", + "eventNonce": 123, + "eventHeight": 12345, + "amount": "1000000000", + "denom": "peggy0x...", + "orchestratorAddress": "inj1...", + "state": "completed", + "txHashesList": ["0x..."] + } +] +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getPeggyWithdrawalTxsTemplate = ` +Extract the following details for Peggy withdrawal transactions: +- **sender** (string, optional): Sender address +- **receiver** (string, optional): Receiver address +- **limit** (number, optional): Number of results +- **skip** (number, optional): Number of results to skip + +Provide the request in the following JSON format: + +\`\`\`json +{ + "sender": "inj1...", + "receiver": "eth_address", + "limit": 10, + "skip": 0 +} +\`\`\` + +Response format: + +\`\`\`json +[ + { + "sender": "inj1...", + "receiver": "eth_address", + "amount": "1000000000", + "denom": "peggy0x...", + "bridgeFee": "1000000", + "outgoingTxId": 123, + "batchTimeout": 100, + "batchNonce": 5, + "state": "completed", + "txHashesList": ["0x..."] + } +] +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getBlocksTemplate = ` +Extract the following details for blocks query: +- **before** (number, optional): Results before this block +- **after** (number, optional): Results after this block +- **limit** (number, optional): Number of results +- **from** (number, optional): Start block height +- **to** (number, optional): End block height + +Provide the request in the following JSON format: + +\`\`\`json +{ + "before": 12345, + "after": 12300, + "limit": 10, + "from": 12300, + "to": 12345 +} +\`\`\` + +Response format: + +\`\`\`json +{ + "blocks": [ + { + "height": 12345, + "proposer": "injvaloper1...", + "moniker": "Validator Name", + "blockHash": "0x...", + "parentHash": "0x...", + "numPreCommits": 150, + "numTxs": 10, + "timestamp": "2024-01-11T12:00:00Z" + } + ] +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getBlockTemplate = ` +Extract the following details for block lookup: +- **id** (string): Block height or hash + +Provide the request in the following JSON format: + +\`\`\`json +{ + "id": "12345" +} +\`\`\` + +Response format: + +\`\`\`json +{ + "block": { + "height": 12345, + "proposer": "injvaloper1...", + "moniker": "Validator Name", + "blockHash": "0x...", + "parentHash": "0x...", + "numPreCommits": 150, + "numTxs": 10, + "timestamp": "2024-01-11T12:00:00Z" + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getTxsTemplate = ` +Extract the following details for transactions query: +- **before** (number, optional): Results before this block +- **after** (number, optional): Results after this block +- **limit** (number, optional): Number of results +- **skip** (number, optional): Number of results to skip +- **type** (string, optional): Transaction type filter +- **chainModule** (string, optional): Chain module filter +- **startTime** (number, optional): Start timestamp +- **endTime** (number, optional): End timestamp + +Provide the request in the following JSON format: + +\`\`\`json +{ + "before": 12345, + "after": 12300, + "limit": 10, + "skip": 0, + "type": "MsgSend", + "chainModule": "bank", + "startTime": 1641859200, + "endTime": 1641945600 +} +\`\`\` + +Response format: + +\`\`\`json +{ + "transactions": [ + { + "id": "tx_id", + "blockNumber": 12345, + "blockTimestamp": "2024-01-11T12:00:00Z", + "hash": "0x...", + "txType": "MsgSend" + } + ] +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getIBCTransferTxsTemplate = ` +Extract the following details for IBC transfer transactions: +- **sender** (string, optional): Sender address +- **receiver** (string, optional): Receiver address +- **srcChannel** (string, optional): Source channel +- **srcPort** (string, optional): Source port +- **destChannel** (string, optional): Destination channel +- **destPort** (string, optional): Destination port +- **limit** (number, optional): Number of results +- **skip** (number, optional): Number of results to skip + +Provide the request in the following JSON format: + +\`\`\`json +{ + "sender": "inj1...", + "receiver": "cosmos1...", + "srcChannel": "channel-1", + "srcPort": "transfer", + "destChannel": "channel-0", + "destPort": "transfer", + "limit": 10, + "skip": 0 +} +\`\`\` + +Response format: + +\`\`\`json +[ + { + "sender": "inj1...", + "receiver": "cosmos1...", + "sourcePort": "transfer", + "sourceChannel": "channel-1", + "destinationPort": "transfer", + "destinationChannel": "channel-0", + "amount": "1000000000", + "denom": "inj", + "timeoutHeight": "1-1000000", + "timeoutTimestamp": 1641945600, + "state": "completed" + } +] +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getExplorerStatsTemplate = ` +Extract explorer statistics. + +Response format: + +\`\`\`json +{ + "assets": "1000", + "txsTotal": "1000000", + "addresses": "50000", + "injSupply": "100000000", + "txsInPast30Days": "100000", + "txsInPast24Hours": "10000", + "blockCountInPast24Hours": "5000", + "txsPerSecondInPast24Hours": "0.5", + "txsPerSecondInPast100Blocks": "0.8" +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/template/gov.ts b/packages/plugin-injective/injective-sdk-client-ts/src/template/gov.ts new file mode 100644 index 00000000000..3f6467b1ffb --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/template/gov.ts @@ -0,0 +1,503 @@ +// Governance Module Templates + +export const getGovernanceModuleParamsTemplate = ` +Extract the following details to get governance module parameters: +- **votingParams** (object): Contains: + - **votingPeriod** (number): Duration of the voting period in seconds +- **tallyParams** (object): Contains: + - **quorum** (string): Minimum percentage of voting power required + - **threshold** (string): Minimum percentage for proposal to pass + - **vetoThreshold** (string): Minimum veto percentage to reject +- **depositParams** (object): Contains: + - **minDepositList** (array): Required minimum deposits + - **maxDepositPeriod** (number): Maximum deposit period in seconds + +Provide the response in the following JSON format: + +\`\`\`json +{ + "votingParams": { + "votingPeriod": 604800 + }, + "tallyParams": { + "quorum": "0.334", + "threshold": "0.5", + "vetoThreshold": "0.334" + }, + "depositParams": { + "minDepositList": [ + { + "denom": "inj", + "amount": "100000000000000000000" + } + ], + "maxDepositPeriod": 1209600 + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getProposalsTemplate = ` +Extract the following details for retrieving proposals: +- **status** (CosmosGovV1Gov.ProposalStatus): Filter by proposal status +- **pagination** (PaginationOption): Optional pagination parameters + +Response will contain: +- **proposals** (Proposal[]): List of proposals +- **pagination**: Pagination response information + +Provide the request in the following JSON format: + +\`\`\`json +{ + "status": 2, + "pagination": { + "key": "", + "offset": 0, + "limit": 100, + "countTotal": true + } +} +\`\`\` + +Response format: + +\`\`\`json +{ + "proposals": [ + { + "proposalId": 1, + "title": "Example Proposal", + "summary": "This is an example proposal", + "proposer": "inj1...", + "status": 2, + "finalTallyResult": { + "yesCount": "100", + "abstainCount": "10", + "noCount": "5", + "noWithVetoCount": "2" + }, + "submitTime": 1632150400, + "depositEndTime": 1633360000, + "votingStartTime": 1633360000, + "votingEndTime": 1633964800, + "totalDeposits": [ + { + "denom": "inj", + "amount": "100000000000000000000" + } + ] + } + ], + "pagination": { + "nextKey": "", + "total": 100 + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getProposalTemplate = ` +Extract the following details for retrieving a specific proposal: +- **proposalId** (number): The ID of the proposal + +Provide the request in the following JSON format: + +\`\`\`json +{ + "proposalId": 1 +} +\`\`\` + +Response format: + +\`\`\`json +{ + "proposalId": 1, + "title": "Example Proposal", + "summary": "This is an example proposal", + "proposer": "inj1...", + "status": 2, + "finalTallyResult": { + "yesCount": "100", + "abstainCount": "10", + "noCount": "5", + "noWithVetoCount": "2" + }, + "submitTime": 1632150400, + "depositEndTime": 1633360000, + "votingStartTime": 1633360000, + "votingEndTime": 1633964800, + "totalDeposits": [ + { + "denom": "inj", + "amount": "100000000000000000000" + } + ] +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getProposalDepositsTemplate = ` +Extract the following details for retrieving proposal deposits: +- **proposalId** (number): The ID of the proposal +- **pagination** (PaginationOption): Optional pagination parameters + +Response will contain: +- **deposits** (ProposalDeposit[]): List of deposits +- **pagination**: Pagination response information + +Request format: + +\`\`\`json +{ + "proposalId": 1, + "pagination": { + "key": "", + "offset": 0, + "limit": 100, + "countTotal": true + } +} +\`\`\` + +Response format: + +\`\`\`json +{ + "deposits": [ + { + "depositor": "inj1...", + "amounts": [ + { + "denom": "inj", + "amount": "100000000000000000000" + } + ] + } + ], + "pagination": { + "nextKey": "", + "total": 10 + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getProposalVotesTemplate = ` +Extract the following details for retrieving proposal votes: +- **proposalId** (number): The ID of the proposal +- **pagination** (PaginationOption): Optional pagination parameters + +Request format: + +\`\`\`json +{ + "proposalId": 1, + "pagination": { + "key": "", + "offset": 0, + "limit": 100, + "countTotal": true + } +} +\`\`\` + +Response format: + +\`\`\`json +{ + "votes": [ + { + "proposalId": 1, + "voter": "inj1...", + "options": [ + { + "option": 1, + "weight": "1.0" + } + ], + "metadata": "" + } + ], + "pagination": { + "nextKey": "", + "total": 100 + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getProposalTallyTemplate = ` +Extract the following details for retrieving proposal tally: +- **proposalId** (number): The ID of the proposal + +Request format: + +\`\`\`json +{ + "proposalId": 1 +} +\`\`\` + +Response format: + +\`\`\`json +{ + "yesCount": "100", + "abstainCount": "10", + "noCount": "5", + "noWithVetoCount": "2" +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const msgSubmitProposalExpiryFuturesMarketLaunchTemplate = ` +Extract the following details for submitting an expiry futures market launch proposal: +- **title** (string): Proposal title +- **description** (string): Proposal description +- **marketId** (string): Market identifier +- **ticker** (string): Market ticker symbol +- **quoteDenom** (string): Quote denomination +- **oracleBase** (string): Oracle base +- **oracleQuote** (string): Oracle quote +- **expiry** (number): Expiry timestamp +- **initialDeposit** (Coin[]): Initial deposit amount + +Request format: + +\`\`\`json +{ + "title": "Launch BTC-USDT Quarterly Futures", + "description": "Proposal to launch BTC-USDT quarterly futures market", + "marketId": "0x123...", + "ticker": "BTC-USDT-Q", + "quoteDenom": "peggy0x123...USDT", + "oracleBase": "BTC", + "oracleQuote": "USDT", + "expiry": 1640995200, + "initialDeposit": [ + { + "denom": "inj", + "amount": "100000000000000000000" + } + ] +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const msgSubmitProposalSpotMarketLaunchTemplate = ` +Extract the following details for submitting a spot market launch proposal: +- **title** (string): Proposal title +- **description** (string): Proposal description +- **ticker** (string): Market ticker symbol +- **baseDenom** (string): Base denomination +- **quoteDenom** (string): Quote denomination +- **initialDeposit** (Coin[]): Initial deposit amount + +Request format: + +\`\`\`json +{ + "title": "Launch INJ-USDT Spot Market", + "description": "Proposal to launch INJ-USDT spot market", + "ticker": "INJ-USDT", + "baseDenom": "inj", + "quoteDenom": "peggy0x123...USDT", + "initialDeposit": [ + { + "denom": "inj", + "amount": "100000000000000000000" + } + ] +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const msgSubmitProposalPerpetualMarketLaunchTemplate = ` +Extract the following details for submitting a perpetual market launch proposal: +- **title** (string): Proposal title +- **description** (string): Proposal description +- **ticker** (string): Market ticker symbol +- **quoteDenom** (string): Quote denomination +- **oracleBase** (string): Oracle base +- **oracleQuote** (string): Oracle quote +- **initialDeposit** (Coin[]): Initial deposit amount + +Request format: + +\`\`\`json +{ + "title": "Launch ETH-USDT Perpetual", + "description": "Proposal to launch ETH-USDT perpetual market", + "ticker": "ETH-USDT-PERP", + "quoteDenom": "peggy0x123...USDT", + "oracleBase": "ETH", + "oracleQuote": "USDT", + "initialDeposit": [ + { + "denom": "inj", + "amount": "100000000000000000000" + } + ] +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const msgVoteTemplate = ` +Extract the following details for submitting a vote: +- **proposalId** (number): The ID of the proposal +- **options** (WeightedVoteOption[]): Vote options with weights +- **metadata** (string): Optional vote metadata + +Request format: + +\`\`\`json +{ + "proposalId": 1, + "options": [ + { + "option": 1, + "weight": "1.0" + } + ], + "metadata": "" +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const msgSubmitTextProposalTemplate = ` +Extract the following details for submitting a text proposal: +- **title** (string): Proposal title +- **description** (string): Proposal description +- **initialDeposit** (Coin[]): Initial deposit amount + +Request format: + +\`\`\`json +{ + "title": "Community Pool Spend", + "description": "Proposal to spend community pool funds", + "initialDeposit": [ + { + "denom": "inj", + "amount": "100000000000000000000" + } + ] +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const msgSubmitProposalSpotMarketParamUpdateTemplate = ` +Extract the following details for submitting a spot market parameter update proposal: +- **title** (string): Proposal title +- **description** (string): Proposal description +- **marketId** (string): Market identifier +- **makerFeeRate** (string): Maker fee rate +- **takerFeeRate** (string): Taker fee rate +- **initialDeposit** (Coin[]): Initial deposit amount + +Request format: + +\`\`\`json +{ + "title": "Update INJ-USDT Spot Market Parameters", + "description": "Proposal to update INJ-USDT spot market parameters", + "marketId": "0x123...", + "makerFeeRate": "-0.0001", + "takerFeeRate": "0.001", + "initialDeposit": [ + { + "denom": "inj", + "amount": "100000000000000000000" + } + ] +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const msgSubmitGenericProposalTemplate = ` +Extract the following details for submitting a generic proposal: +- **title** (string): Proposal title +- **description** (string): Proposal description +- **messages** (any[]): Proposal messages +- **initialDeposit** (Coin[]): Initial deposit amount + +Request format: + +\`\`\`json +{ + "title": "Generic Proposal", + "description": "Generic governance proposal", + "messages": [], + "initialDeposit": [ + { + "denom": "inj", + "amount": "100000000000000000000" + } + ] +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const msgGovDepositTemplate = ` +Extract the following details for depositing to a proposal: +- **proposalId** (number): The ID of the proposal +- **amount** (Coin[]): Deposit amount + +Request format: + +\`\`\`json +{ + "proposalId": 1, + "amount": [ + { + "denom": "inj", + "amount": "100000000000000000000" + } + ] +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/template/ibc.ts b/packages/plugin-injective/injective-sdk-client-ts/src/template/ibc.ts new file mode 100644 index 00000000000..b97e6a1f38c --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/template/ibc.ts @@ -0,0 +1,135 @@ +// IBC Module Templates + +export const getDenomTraceTemplate = ` +Extract the following details to get denom trace information: +- **hash** (string): The hash of the denomination to trace + +Provide the request in the following JSON format: + +\`\`\`json +{ + "hash": "hash_string" +} +\`\`\` + +The response will contain: +- **path** (string): Chain of port/channel identifiers used for tracing +- **baseDenom** (string): Base denomination of the relayed fungible token + +Response format: + +\`\`\`json +{ + "path": "transfer/channel-0/transfer/channel-1", + "baseDenom": "uatom" +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getDenomsTraceTemplate = ` +Extract the following details to get multiple denom traces: +- **pagination** (object): Optional pagination parameters containing: + - **key** (string): Pagination key + - **offset** (number): Pagination offset + - **limit** (number): Number of records to return + - **countTotal** (boolean): Whether to count total records + +Provide the request in the following JSON format: + +\`\`\`json +{ + "pagination": { + "key": "", + "offset": 0, + "limit": 100, + "countTotal": true + } +} +\`\`\` + +The response will contain an array of denom traces: +- **denomTraces** (array): List of denomination traces, each containing: + - **path** (string): Chain of port/channel identifiers + - **baseDenom** (string): Base denomination +- **pagination** (object): Pagination response information + +Response format: + +\`\`\`json +{ + "denomTraces": [ + { + "path": "transfer/channel-0/transfer/channel-1", + "baseDenom": "uatom" + }, + { + "path": "transfer/channel-2", + "baseDenom": "uosmo" + } + ], + "pagination": { + "nextKey": "", + "total": 10 + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const msgIBCTransferTemplate = ` +Extract the following details for IBC token transfer: +- **sourcePort** (string): Source port ID (e.g., "transfer") +- **sourceChannel** (string): Source channel ID +- **token** (object): Token to transfer containing: + - **denom** (string): Token denomination + - **amount** (string): Token amount +- **receiver** (string): Receiver address on destination chain +- **timeoutHeight** (object): Optional timeout height containing: + - **revisionNumber** (string): Chain revision number + - **revisionHeight** (string): Block height for timeout +- **timeoutTimestamp** (string): Optional timeout timestamp in nanoseconds +- **memo** (string): Optional transfer memo + +Ensure that: +1. Port ID and channel ID are valid +2. Token amount is positive +3. Receiver address is valid for destination chain +4. Either timeoutHeight or timeoutTimestamp is specified + +Provide the transfer details in the following JSON format: + +\`\`\`json +{ + "sourcePort": "transfer", + "sourceChannel": "channel-0", + "token": { + "denom": "inj", + "amount": "1000000000000000000" + }, + "receiver": "cosmos1...", + "timeoutHeight": { + "revisionNumber": "1", + "revisionHeight": "1000000" + }, + "timeoutTimestamp": "1640995200000000000", + "memo": "Optional transfer memo" +} +\`\`\` + +Success response format: + +\`\`\`json +{ + "txHash": "0x...", + "success": true +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/template/index.ts b/packages/plugin-injective/injective-sdk-client-ts/src/template/index.ts new file mode 100644 index 00000000000..5045f3233d2 --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/template/index.ts @@ -0,0 +1,15 @@ +export * from "./auction"; +export * from "./auth"; +export * from "./bank"; +export * from "./distribution"; +export * from "./exchange"; +export * from "./gov"; +export * from "./ibc"; +export * from "./insurance"; +export * from "./mint"; +export * from "./mito"; +export * from "./peggy"; +export * from "./permissions"; +export * from "./staking"; +export * from "./token-factory"; +export * from "./wasm"; diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/template/insurance.ts b/packages/plugin-injective/injective-sdk-client-ts/src/template/insurance.ts new file mode 100644 index 00000000000..3d7b09d98ae --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/template/insurance.ts @@ -0,0 +1,246 @@ +// Insurance Fund Module Templates + +export const getInsuranceModuleParamsTemplate = ` +Extract the following details for insurance module parameters: +- **defaultRedemptionNoticePeriodDuration** (number): Default duration for redemption notice period in seconds + +Provide the response in the following JSON format: + +\`\`\`json +{ + "defaultRedemptionNoticePeriodDuration": 1209600 +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getInsuranceFundsTemplate = ` +Request to fetch all insurance funds. No parameters required. + +Response will contain an array of insurance funds with the following details: +- **depositDenom** (string): Denomination of deposits +- **insurancePoolTokenDenom** (string): Denomination of pool tokens +- **redemptionNoticePeriodDuration** (number): Duration for redemption notice +- **balance** (string): Current fund balance +- **totalShare** (string): Total share amount +- **marketId** (string): Market identifier +- **marketTicker** (string): Market ticker symbol +- **oracleBase** (string): Oracle base asset +- **oracleQuote** (string): Oracle quote asset +- **oracleType** (number): Type of oracle +- **expiry** (number): Expiry timestamp + +Response format: + +\`\`\`json +{ + "insuranceFunds": [ + { + "depositDenom": "inj", + "insurancePoolTokenDenom": "share1", + "redemptionNoticePeriodDuration": 1209600, + "balance": "1000000000000000000", + "totalShare": "1000000000000000000", + "marketId": "0x1234...", + "marketTicker": "BTC/USDT", + "oracleBase": "BTC", + "oracleQuote": "USDT", + "oracleType": 1, + "expiry": 1640995200 + } + ] +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getInsuranceFundTemplate = ` +Extract the following details to get a specific insurance fund: +- **marketId** (string): Market identifier for the insurance fund + +Request format: + +\`\`\`json +{ + "marketId": "0x1234..." +} +\`\`\` + +Response format: + +\`\`\`json +{ + "depositDenom": "inj", + "insurancePoolTokenDenom": "share1", + "redemptionNoticePeriodDuration": 1209600, + "balance": "1000000000000000000", + "totalShare": "1000000000000000000", + "marketId": "0x1234...", + "marketTicker": "BTC/USDT", + "oracleBase": "BTC", + "oracleQuote": "USDT", + "oracleType": 1, + "expiry": 1640995200 +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getEstimatedRedemptionsTemplate = ` +Extract the following details for estimated redemptions: +- **marketId** (string): Market identifier +- **address** (string): Account address + +Request format: + +\`\`\`json +{ + "marketId": "0x1234...", + "address": "inj1..." +} +\`\`\` + +Response will contain array of redemption amounts: +- **amounts** (array): List of redemption amounts containing: + - **amount** (string): Redemption amount + - **denom** (string): Token denomination + +Response format: + +\`\`\`json +{ + "amounts": [ + { + "amount": "1000000000000000000", + "denom": "inj" + } + ] +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getPendingRedemptionsTemplate = ` +Extract the following details for pending redemptions: +- **marketId** (string): Market identifier +- **address** (string): Account address + +Request format: + +\`\`\`json +{ + "marketId": "0x1234...", + "address": "inj1..." +} +\`\`\` + +Response will contain array of pending redemption amounts: +- **amounts** (array): List of pending redemption amounts containing: + - **amount** (string): Redemption amount + - **denom** (string): Token denomination + +Response format: + +\`\`\`json +{ + "amounts": [ + { + "amount": "1000000000000000000", + "denom": "inj" + } + ] +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const msgCreateInsuranceFundTemplate = ` +Extract the following details for creating an insurance fund: +- **marketId** (string): Market identifier +- **ticker** (string): Market ticker symbol +- **quoteDenom** (string): Quote denomination +- **oracleBase** (string): Oracle base asset +- **oracleQuote** (string): Oracle quote asset +- **oracleType** (number): Type of oracle +- **expiry** (number): Optional expiry timestamp +- **initialDeposit** (object): Initial deposit containing: + - **amount** (string): Deposit amount + - **denom** (string): Token denomination + +Request format: + +\`\`\`json +{ + "marketId": "0x1234...", + "ticker": "BTC/USDT", + "quoteDenom": "peggy0x...", + "oracleBase": "BTC", + "oracleQuote": "USDT", + "oracleType": 1, + "expiry": 1640995200, + "initialDeposit": { + "amount": "1000000000000000000", + "denom": "inj" + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const msgRequestRedemptionTemplate = ` +Extract the following details for requesting a redemption: +- **marketId** (string): Market identifier +- **amount** (object): Redemption amount containing: + - **amount** (string): Amount to redeem + - **denom** (string): Token denomination + +Request format: + +\`\`\`json +{ + "marketId": "0x1234...", + "amount": { + "amount": "1000000000000000000", + "denom": "share1" + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const msgUnderwriteTemplate = ` +Extract the following details for underwriting an insurance fund: +- **marketId** (string): Market identifier +- **deposit** (object): Deposit amount containing: + - **amount** (string): Amount to deposit + - **denom** (string): Token denomination + +Request format: + +\`\`\`json +{ + "marketId": "0x1234...", + "deposit": { + "amount": "1000000000000000000", + "denom": "inj" + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/template/mint.ts b/packages/plugin-injective/injective-sdk-client-ts/src/template/mint.ts new file mode 100644 index 00000000000..10ed5c94768 --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/template/mint.ts @@ -0,0 +1,65 @@ +// Mint Module Templates + +export const getMintModuleParamsTemplate = ` +Extract the mint module parameters. + +The response will contain: +- **mintDenom** (string): Type of coin to mint +- **inflationRateChange** (string): Maximum annual change in inflation rate +- **inflationMax** (string): Maximum inflation rate +- **inflationMin** (string): Minimum inflation rate +- **goalBonded** (string): Goal of percent bonded atoms +- **blocksPerYear** (string): Expected blocks per year + +Response format: + +\`\`\`json +{ + "mintDenom": "inj", + "inflationRateChange": "0.130000000000000000", + "inflationMax": "0.200000000000000000", + "inflationMin": "0.070000000000000000", + "goalBonded": "0.670000000000000000", + "blocksPerYear": "6311520" +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getInflationTemplate = ` +Extract the current inflation rate. + +The response will contain: +- **inflation** (string): Current inflation rate + +Response format: + +\`\`\`json +{ + "inflation": "0.130000000000000000" +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getAnnualProvisionsTemplate = ` +Extract the current annual provisions. + +The response will contain: +- **annualProvisions** (string): Current annual provisions + +Response format: + +\`\`\`json +{ + "annualProvisions": "5000000000000000000000000" +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/template/mito.ts b/packages/plugin-injective/injective-sdk-client-ts/src/template/mito.ts new file mode 100644 index 00000000000..980269a967b --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/template/mito.ts @@ -0,0 +1,1242 @@ +// Mito Module Templates + +export const getVaultTemplate = ` +Extract the following details for retrieving a specific vault: +- **contractAddress** (string): Optional contract address +- **slug** (string): Optional vault slug + +Request format: + +\`\`\`json +{ + "contractAddress": "inj1...", + "slug": "vault-slug" +} +\`\`\` + +Response format: + +\`\`\`json +{ + "contractAddress": "inj1...", + "codeId": "1", + "vaultName": "Example Vault", + "marketId": "0x123...", + "currentTvl": 1000000, + "profits": { + "allTimeChange": 10.5, + "threeMonthsChange": 5.2, + "oneMonthChange": 2.1, + "oneDayChange": 0.5, + "oneWeekChange": 1.2, + "oneYearChange": 15.3, + "threeYearsChange": 45.6, + "sixMonthsChange": 8.4 + }, + "updatedAt": 1632150400, + "vaultType": "perpetual", + "lpTokenPrice": 1.05, + "subaccountInfo": { + "subaccountId": "0x123...", + "balancesList": [ + { + "denom": "inj", + "totalBalance": "1000000000" + } + ] + }, + "masterContractAddress": "inj1...", + "totalLpAmount": "1000000", + "slug": "vault-slug", + "createdAt": 1632150400, + "notionalValueCap": "10000000", + "tvlChanges": { + "allTimeChange": 20.5 + }, + "apy": 15.2, + "apy7D": 14.8, + "apy7DFq": 14.9, + "apyue": 15.0, + "apyV3": 15.1, + "registrationMode": "open" +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getVaultsTemplate = ` +Extract the following details for retrieving vaults: +- **limit** (number): Optional number of records +- **codeId** (string): Optional code ID filter +- **pageIndex** (number): Optional page index + +Request format: + +\`\`\`json +{ + "limit": 10, + "codeId": "1", + "pageIndex": 0 +} +\`\`\` + +Response format: + +\`\`\`json +{ + "vaults": [ + { + "contractAddress": "inj1...", + "vaultName": "Example Vault", + "currentTvl": 1000000, + "lpTokenPrice": 1.05, + "apy": 15.2 + } + ], + "pagination": { + "total": 100 + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getLpTokenPriceChartTemplate = ` +Extract the following details for LP token price chart: +- **to** (string): Optional end timestamp +- **from** (string): Optional start timestamp +- **vaultAddress** (string): Vault address + +Request format: + +\`\`\`json +{ + "to": "1640995200", + "from": "1633360000", + "vaultAddress": "inj1..." +} +\`\`\` + +Response format: + +\`\`\`json +{ + "priceSnapshots": [ + { + "price": 1.05, + "updatedAt": 1633360000 + } + ] +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getTVLChartTemplate = ` +Extract the following details for TVL chart: +- **to** (string): Optional end timestamp +- **from** (string): Optional start timestamp +- **vaultAddress** (string): Vault address + +Request format: + +\`\`\`json +{ + "to": "1640995200", + "from": "1633360000", + "vaultAddress": "inj1..." +} +\`\`\` + +Response format: + +\`\`\`json +{ + "priceSnapshots": [ + { + "price": 1000000, + "updatedAt": 1633360000 + } + ] +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getVaultsByHolderAddressTemplate = ` +Extract the following details for vaults by holder: +- **skip** (number): Optional skip count +- **limit** (number): Optional number of records +- **holderAddress** (string): Holder address +- **vaultAddress** (string): Optional vault address + +Request format: + +\`\`\`json +{ + "skip": 0, + "limit": 10, + "holderAddress": "inj1...", + "vaultAddress": "inj1..." +} +\`\`\` + +Response format: + +\`\`\`json +{ + "subscriptions": [ + { + "vaultInfo": { + "contractAddress": "inj1...", + "vaultName": "Example Vault", + "currentTvl": 1000000 + }, + "lpAmount": "1000000", + "holderAddress": "inj1...", + "lpAmountPercentage": 0.1 + } + ], + "pagination": { + "total": 100 + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getLPHoldersTemplate = ` +Extract the following details for LP holders: +- **skip** (number): Optional skip count +- **limit** (number): Optional number of records +- **vaultAddress** (string): Vault address +- **stakingContractAddress** (string): Staking contract address + +Request format: + +\`\`\`json +{ + "skip": 0, + "limit": 10, + "vaultAddress": "inj1...", + "stakingContractAddress": "inj1..." +} +\`\`\` + +Response format: + +\`\`\`json +{ + "holders": [ + { + "holderAddress": "inj1...", + "vaultAddress": "inj1...", + "amount": "1000000", + "updatedAt": 1633360000, + "lpAmountPercentage": 0.1, + "redemptionLockTime": "1640995200", + "stakedAmount": "500000" + } + ], + "pagination": { + "total": 100 + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getHolderPortfolioTemplate = ` +Extract the following details for holder portfolio: +- **holderAddress** (string): Holder address +- **stakingContractAddress** (string): Staking contract address + +Request format: + +\`\`\`json +{ + "holderAddress": "inj1...", + "stakingContractAddress": "inj1..." +} +\`\`\` + +Response format: + +\`\`\`json +{ + "totalValue": 1000000, + "pnl": 50000, + "totalValueChartList": [ + { + "price": 1000000, + "updatedAt": 1633360000 + } + ], + "pnlChartList": [ + { + "price": 50000, + "updatedAt": 1633360000 + } + ], + "updatedAt": 1633360000 +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getLeaderboardTemplate = ` +Extract the following details for leaderboard: +- **epochId** (number): Optional epoch ID + +Request format: + +\`\`\`json +{ + "epochId": 1 +} +\`\`\` + +Response format: + +\`\`\`json +{ + "entriesList": [ + { + "address": "inj1...", + "pnl": 50000 + } + ], + "snapshotBlock": "1000000", + "updatedAt": 1633360000, + "epochId": 1 +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getLeaderboardEpochsTemplate = ` +Extract the following details for leaderboard epochs: +- **limit** (number): Optional number of records +- **toEpochId** (number): Optional end epoch ID +- **fromEpochId** (number): Optional start epoch ID + +Request format: + +\`\`\`json +{ + "limit": 10, + "toEpochId": 10, + "fromEpochId": 1 +} +\`\`\` + +Response format: + +\`\`\`json +{ + "epochs": [ + { + "epochId": 1, + "startAt": 1633360000, + "endAt": 1640995200, + "isLive": true + } + ], + "pagination": { + "total": 10 + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getTransferHistoryTemplate = ` +Extract the following details for transfer history: +- **vault** (string): Optional vault address +- **account** (string): Optional account address +- **limit** (number): Optional number of records +- **toNumber** (number): Optional end number +- **fromNumber** (number): Optional start number + +Request format: + +\`\`\`json +{ + "vault": "inj1...", + "account": "inj1...", + "limit": 10, + "toNumber": 100, + "fromNumber": 1 +} +\`\`\` + +Response format: + +\`\`\`json +{ + "transfers": [ + { + "lpAmount": "1000000", + "coins": [ + { + "denom": "inj", + "amount": "1000000" + } + ], + "usdValue": "1000000", + "isDeposit": true, + "executedAt": 1633360000, + "account": "inj1...", + "vault": "inj1...", + "txHash": "0x...", + "tidByVault": 1, + "tidByAccount": 1 + } + ], + "pagination": { + "total": 100 + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getStakingPoolsTemplate = ` +Extract the following details for staking pools: +- **staker** (string): Optional staker address +- **stakingContractAddress** (string): Staking contract address + +Request format: + +\`\`\`json +{ + "staker": "inj1...", + "stakingContractAddress": "inj1..." +} +\`\`\` + +Response format: + +\`\`\`json +{ + "pools": [ + { + "vaultName": "Example Vault", + "vaultAddress": "inj1...", + "stakeDenom": "inj", + "gauges": [ + { + "id": "1", + "owner": "inj1...", + "startTimestamp": 1633360000, + "endTimestamp": 1640995200, + "rewardTokens": [ + { + "denom": "inj", + "amount": "1000000" + } + ], + "lastDistribution": 1633360000, + "status": "active" + } + ], + "apr": 15.2, + "totalLiquidity": 1000000, + "stakingAddress": "inj1...", + "aprBreakdown": { + "inj": 15.2 + } + } + ], + "pagination": { + "total": 10 + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getStakingHistoryTemplate = ` +Extract the following details for staking history: +- **staker** (string): Optional staker address +- **toNumber** (number): Optional end number +- **limit** (number): Optional number of records +- **fromNumber** (number): Optional start number + +Request format: + +\`\`\`json +{ + "staker": "inj1...", + "toNumber": 100, + "limit": 10, + "fromNumber": 1 +} +\`\`\` + +Response format: + +\`\`\`json +{ + "activities": [ + { + "action": "stake", + "txHash": "0x...", + "staker": "inj1...", + "vaultAddress": "inj1...", + "numberByAccount": 1, + "timestamp": 1633360000, + "rewardedTokens": [ + { + "denom": "inj", + "amount": "1000000" + } + ], + "stakeAmount": { + "denom": "inj", + "amount": "1000000" + } + } + ], + "pagination": { + "total": 100 + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getStakingRewardsByAccountTemplate = ` +Extract the following details for staking rewards: +- **staker** (string): Staker address +- **stakingContractAddress** (string): Staking contract address + +Request format: + +\`\`\`json +{ + "staker": "inj1...", + "stakingContractAddress": "inj1..." +} +\`\`\` + +Response format: + +\`\`\`json +{ + "rewards": [ + { + "apr": 15.2, + "vaultName": "Example Vault", + "vaultAddress": "inj1...", + "lockTimestamp": 1633360000, + "claimableRewards": [ + { + "denom": "inj", + "amount": "1000000" + } + ], + "stakedAmount": { + "denom": "inj", + "amount": "1000000" + }, + "lockedAmount": { + "denom": "inj", + "amount": "1000000" + } + } + ], + "pagination": { + "total": 10 + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getMissionsTemplate = ` +Extract the following details for retrieving missions: +- **accountAddress** (string): Account address + +Request format: + +\`\`\`json +{ + "accountAddress": "inj1..." +} +\`\`\` + +Response format: + +\`\`\`json +{ + "missions": [ + { + "id": "mission1", + "points": "100", + "completed": true, + "accruedPoints": "50", + "updatedAt": 1633360000, + "progress": 0.5, + "expected": 100 + } + ] +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getMissionLeaderboardTemplate = ` +Extract the following details for mission leaderboard: +- **userAddress** (string): Optional user address + +Request format: + +\`\`\`json +{ + "userAddress": "inj1..." +} +\`\`\` + +Response format: + +\`\`\`json +{ + "entries": [ + { + "address": "inj1...", + "accruedPoints": "100" + } + ], + "updatedAt": 1633360000, + "rank": "1" +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getIDOTemplate = ` +Extract the following details for IDO information: +- **contractAddress** (string): Contract address +- **accountAddress** (string): Optional account address + +Request format: + +\`\`\`json +{ + "contractAddress": "inj1...", + "accountAddress": "inj1..." +} +\`\`\` + +Response format: + +\`\`\`json +{ + "ido": { + "startTime": 1633360000, + "endTime": 1640995200, + "owner": "inj1...", + "status": "active", + "tokenInfo": { + "denom": "inj", + "supply": "1000000", + "symbol": "INJ", + "decimal": 18, + "logoUrl": "https://example.com/logo.png" + }, + "capPerAddress": "1000000", + "contractAddress": "inj1...", + "subscribedAmount": "500000", + "projectTokenAmount": "1000000", + "targetAmountInQuoteDenom": "1000000", + "secondBeforeStartToSetQuotePrice": 3600, + "targetAmountInUsd": "1000000", + "tokenPrice": 1.0, + "isAccountWhiteListed": true, + "isLaunchWithVault": true, + "isVestingScheduleEnabled": true, + "name": "Example IDO", + "progress": [ + { + "status": "active", + "timestamp": 1633360000 + } + ], + "quoteDenom": "inj", + "stakeToSubscription": [ + { + "stakedAmount": "1000000", + "subscribableAmount": "500000" + } + ], + "useWhitelist": true, + "marketId": "0x...", + "vaultAddress": "inj1..." + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getIDOsTemplate = ` +Extract the following details for retrieving IDOs: +- **status** (string): Optional status filter +- **limit** (number): Optional number of records +- **toNumber** (number): Optional end number +- **accountAddress** (string): Optional account address +- **ownerAddress** (string): Optional owner address + +Request format: + +\`\`\`json +{ + "status": "active", + "limit": 10, + "toNumber": 100, + "accountAddress": "inj1...", + "ownerAddress": "inj1..." +} +\`\`\` + +Response format: + +\`\`\`json +{ + "idos": [ + { + "startTime": 1633360000, + "endTime": 1640995200, + "owner": "inj1...", + "status": "active", + "contractAddress": "inj1...", + "name": "Example IDO" + } + ], + "pagination": { + "total": 100 + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getIDOSubscribersTemplate = ` +Extract the following details for IDO subscribers: +- **skip** (number): Optional skip count +- **limit** (number): Optional number of records +- **sortBy** (string): Optional sort field +- **contractAddress** (string): Contract address + +Request format: + +\`\`\`json +{ + "skip": 0, + "limit": 10, + "sortBy": "subscribedAmount", + "contractAddress": "inj1..." +} +\`\`\` + +Response format: + +\`\`\`json +{ + "marketId": "0x...", + "quoteDenom": "inj", + "subscribers": [ + { + "address": "inj1...", + "subscribedCoin": { + "denom": "inj", + "amount": "1000000" + }, + "lastSubscribeTime": 1633360000, + "estimateTokenReceived": { + "denom": "token", + "amount": "500000" + }, + "createdAt": 1633360000 + } + ], + "pagination": { + "total": 100 + }, + "tokenInfo": { + "denom": "inj", + "supply": "1000000", + "symbol": "INJ", + "decimal": 18, + "logoUrl": "https://example.com/logo.png" + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getIDOSubscriptionTemplate = ` +Extract the following details for IDO subscription: +- **contractAddress** (string): Contract address +- **accountAddress** (string): Account address + +Request format: + +\`\`\`json +{ + "contractAddress": "inj1...", + "accountAddress": "inj1..." +} +\`\`\` + +Response format: + +\`\`\`json +{ + "subscription": { + "maxSubscriptionCoin": { + "denom": "inj", + "amount": "1000000" + }, + "committedAmount": "500000", + "price": 1.0, + "claimableCoins": [ + { + "denom": "token", + "amount": "500000" + } + ], + "rewardClaimed": false, + "tokenInfo": { + "denom": "inj", + "supply": "1000000", + "symbol": "INJ", + "decimal": 18, + "logoUrl": "https://example.com/logo.png" + }, + "quoteDenom": "inj", + "updatedAt": 1633360000, + "stakedAmount": "1000000", + "marketId": "0x..." + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getIDOActivitiesTemplate = ` +Extract the following details for IDO activities: +- **contractAddress** (string): Optional contract address +- **accountAddress** (string): Optional account address +- **limit** (number): Optional number of records +- **toNumber** (string): Optional end number + +Request format: + +\`\`\`json +{ + "contractAddress": "inj1...", + "accountAddress": "inj1...", + "limit": 10, + "toNumber": "100" +} +\`\`\` + +Response format: + +\`\`\`json +{ + "activities": [ + { + "address": "inj1...", + "subscribedCoin": { + "denom": "inj", + "amount": "1000000" + }, + "usdValue": 1000000, + "timestamp": 1633360000, + "txHash": "0x..." + } + ], + "pagination": { + "total": 100 + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getIDOWhitelistTemplate = ` +Extract the following details for IDO whitelist: +- **skip** (number): Optional skip count +- **limit** (number): Optional number of records +- **idoAddress** (string): IDO address + +Request format: + +\`\`\`json +{ + "skip": 0, + "limit": 10, + "idoAddress": "inj1..." +} +\`\`\` + +Response format: + +\`\`\`json +{ + "idoAddress": "inj1...", + "accounts": [ + { + "accountAddress": "inj1...", + "updatedAt": 1633360000, + "weight": "1.0" + } + ], + "pagination": { + "total": 100 + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getClaimReferencesTemplate = ` +Extract the following details for claim references: +- **skip** (number): Optional skip count +- **limit** (number): Optional number of records +- **idoAddress** (string): IDO address +- **accountAddress** (string): Account address + +Request format: + +\`\`\`json +{ + "skip": 0, + "limit": 10, + "idoAddress": "inj1...", + "accountAddress": "inj1..." +} +\`\`\` + +Response format: + +\`\`\`json +{ + "claimReferences": [ + { + "denom": "inj", + "updatedAt": 1633360000, + "claimedAmount": "500000", + "claimableAmount": "1000000", + "accountAddress": "inj1...", + "cwContractAddress": "inj1...", + "idoContractAddress": "inj1...", + "startVestingTime": 1633360000, + "vestingDurationSeconds": 2592000 + } + ], + "pagination": { + "total": 100 + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +//Mito txs +export const getLaunchpadSubscribeTemplate = ` +Extract the following details for launchpad subscription: +- **amount** (number): Amount to subscribe +- **quoteTokenDenom** (string): Quote token denomination +- **quoteTokenDecimals** (number): Quote token decimals +- **contractAddress** (string): Contract address + +Request format: + +\`\`\`json +{ + "amount": 1000, + "quoteTokenDenom": "inj", + "quoteTokenDecimals": 18, + "contractAddress": "inj1..." +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getSubscribeVaultTemplate = ` +Extract the following details for vault subscription: +- **market** (object): Market details including base/quote denominations and decimals +- **baseAmount** (number): Base token amount +- **quoteAmount** (number): Quote token amount +- **subscriptionType** (string): Type of subscription (BaseOnly, QuoteOnly, etc.) +- **vaultDetails** (object): Vault details including subaccount ID and master address +- **slippage** (object): Optional slippage configuration + +Request format: + +\`\`\`json +{ + "market": { + "baseDenom": "inj", + "baseDecimals": 18, + "quoteDecimals": 6, + "quoteDenom": "usdt" + }, + "baseAmount": 1.5, + "quoteAmount": 1000, + "subscriptionType": "BaseOnly", + "vaultDetails": { + "vaultSubaccountId": "0x...", + "vaultMasterAddress": "inj1...", + "vaultType": "crates.io:vault-cpmm-spot" + }, + "slippage": { + "max_penalty": "0.1" + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getInstantiateCPMMVaultTemplate = ` +Extract the following details for instantiating a CPMM vault: +- **MITO_MASTER_CONTRACT_ADDRESS** (string): Mito master contract address +- **CPMM_CONTRACT_CODE** (number): CPMM contract code +- **senderWalletAddress** (string): Sender's wallet address +- **marketId** (string): Market ID +- **feeBps** (number): Fee in basis points +- **baseDecimals** (number): Base token decimals +- **quoteDecimals** (number): Quote token decimals +- **funds** (array): Array of fund objects with denom and amount +- **notionalValueCap** (string): Optional notional value cap +- **pricingStrategy** (object): Optional pricing strategy configuration +- **maxInvariantSensitivityBps** (string): Optional max invariant sensitivity in basis points +- **maxPriceSensitivityBps** (string): Optional max price sensitivity in basis points +- **orderType** (string): Optional order type + +Request format: + +\`\`\`json +{ + "MITO_MASTER_CONTRACT_ADDRESS": "inj1...", + "CPMM_CONTRACT_CODE": 123, + "senderWalletAddress": "inj1...", + "marketId": "0x...", + "feeBps": 30, + "baseDecimals": 18, + "quoteDecimals": 6, + "funds": [ + { + "denom": "inj", + "amount": "1000000000000000000" + } + ], + "notionalValueCap": "1000000", + "pricingStrategy": { + "SmoothingPricingWithRelativePriceRange": { + "bid_range": "0.01", + "ask_range": "0.01" + } + }, + "maxInvariantSensitivityBps": "100", + "maxPriceSensitivityBps": "100", + "orderType": "LIMIT" +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; +export const getLaunchpadClaimTemplate = ` +Extract the following details for claiming launchpad tokens: +- **contractAddress** (string): Contract address of the launchpad + +Request format: + +\`\`\`json +{ + "contractAddress": "inj1..." +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; +export const getVaultSubscribeTemplate = ` +Extract the following details for subscribing to a vault: +- **vaultType** (string): Type of vault contract +- **slippage** (object): Optional slippage configuration +- **vaultSubaccountId** (string): Vault subaccount ID +- **baseAmount** (number): Base token amount +- **quoteAmount** (number): Quote token amount +- **market** (object): Market details including base/quote denominations and decimals +- **subscriptionType** (string): Type of subscription +- **masterAddress** (string): Master contract address + +Request format: + +\`\`\`json +{ + "vaultType": "crates.io:vault-cpmm-spot", + "slippage": { + "max_penalty": "0.1" + }, + "vaultSubaccountId": "0x...", + "baseAmount": 1.5, + "quoteAmount": 1000, + "market": { + "baseDenom": "inj", + "baseDecimals": 18, + "quoteDenom": "usdt", + "quoteDecimals": 6 + }, + "subscriptionType": "BaseOnly", + "masterAddress": "inj1..." +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getRedeemFromVaultTemplate = ` +Extract the following details for redeeming from a vault: +- **vaultSubaccountId** (string): Vault subaccount ID +- **redeemAmount** (number): Amount to redeem +- **vaultBaseDecimals** (number): Vault base token decimals +- **masterAddress** (string): Master contract address +- **vaultLpDenom** (string): LP token denom +- **marketType** (string): Market type (Spot or Derivative) +- **redemptionType** (string): Type of redemption +- **slippage** (object): Optional slippage configuration + +Request format: + +\`\`\`json +{ + "vaultSubaccountId": "0x...", + "redeemAmount": 0.01, + "vaultBaseDecimals": 18, + "masterAddress": "inj1...", + "vaultLpDenom": "factory/...", + "marketType": "Spot", + "redemptionType": "BaseOnly", + "slippage": { + "max_penalty": "0.1" + } +} +\`\`\` +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getStakeVaultLPTemplate = ` +Extract the following details for staking vault LP tokens: +- **amount** (number): Amount to stake +- **vaultLpDenom** (string): LP token denom +- **vaultTokenDecimals** (number): Token decimals +- **stakingContractAddress** (string): Staking contract address + +Request format: + +\`\`\`json +{ + "amount": 0.01, + "vaultLpDenom": "factory/...", + "vaultTokenDecimals": 18, + "stakingContractAddress": "inj1..." +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getUnstakeVaultLPTemplate = ` +Extract the following details for unstaking vault LP tokens: +- **amount** (number): Amount to unstake +- **vaultLpDenom** (string): LP token denom +- **vaultTokenDecimals** (number): Token decimals +- **stakingContractAddress** (string): Staking contract address + +Request format: + +\`\`\`json +{ + "amount": 0.01, + "vaultLpDenom": "factory/...", + "vaultTokenDecimals": 18, + "stakingContractAddress": "inj1..." +} +\`\`\` + +Response format: +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getClaimVaultRewardsTemplate = ` +Extract the following details for claiming vault rewards: +- **vaultLpDenom** (string): LP token denom +- **stakingContractAddress** (string): Staking contract address + +Request format: + +\`\`\`json +{ + "vaultLpDenom": "factory/...", + "stakingContractAddress": "inj1..." +} +\`\`\` +`; diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/template/peggy.ts b/packages/plugin-injective/injective-sdk-client-ts/src/template/peggy.ts new file mode 100644 index 00000000000..b19332be21b --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/template/peggy.ts @@ -0,0 +1,99 @@ +// Peggy Module Templates + +export const getPeggyModuleParamsTemplate = ` +Extract the Peggy module parameters. + +Response will contain the following parameters: +- **bridgeParams** (object): Bridge parameters containing: + - **bridgeChainId** (string): Chain ID for the bridge + - **peggyId** (string): Unique identifier for the Peggy bridge + - **signedValsetsWindow** (string): Window for signed validator sets + - **signedBatchesWindow** (string): Window for signed batches + - **signedClaimsWindow** (string): Window for signed claims + - **targetBatchTimeout** (string): Target timeout for batches + - **averageBlockTime** (string): Average block time + - **averageEthereumBlockTime** (string): Average Ethereum block time + - **slashFractionValset** (string): Slash fraction for validator sets + - **slashFractionBatch** (string): Slash fraction for batches + - **slashFractionClaim** (string): Slash fraction for claims + - **slashFractionConflictingClaim** (string): Slash fraction for conflicting claims + - **unbondSlashingValsetsWindow** (string): Unbond slashing window for validator sets + - **bridgeContractAddress** (string): Ethereum bridge contract address + - **bridgeActive** (boolean): Whether the bridge is active + - **oracles** (string[]): List of oracle addresses + +Response format: + +\`\`\`json +{ + "bridgeParams": { + "bridgeChainId": "1", + "peggyId": "peggy1", + "signedValsetsWindow": "10000", + "signedBatchesWindow": "10000", + "signedClaimsWindow": "10000", + "targetBatchTimeout": "43200000", + "averageBlockTime": "5000", + "averageEthereumBlockTime": "15000", + "slashFractionValset": "0.001", + "slashFractionBatch": "0.001", + "slashFractionClaim": "0.001", + "slashFractionConflictingClaim": "0.001", + "unbondSlashingValsetsWindow": "10000", + "bridgeContractAddress": "0x...", + "bridgeActive": true, + "oracles": [ + "0x..." + ] + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const msgSendToEthTemplate = ` +Extract the following details for sending tokens to Ethereum: +- **amount** (object): Token amount containing: + - **denom** (string): Token denomination + - **amount** (string): Token amount +- **bridgeFee** (object): Bridge fee containing: + - **denom** (string): Fee denomination + - **amount** (string): Fee amount +- **ethDest** (string): Destination Ethereum address + +Ensure that: +1. Amount is positive and properly formatted +2. Bridge fee is sufficient for the transfer +3. Ethereum destination address is valid +4. Token denomination is supported by the bridge + +Request format: + +\`\`\`json +{ + "amount": { + "denom": "inj", + "amount": "1000000000000000000" + }, + "bridgeFee": { + "denom": "inj", + "amount": "1000000000000000" + }, + "ethDest": "0x..." +} +\`\`\` + +Success response format: + +\`\`\`json +{ + "txHash": "0x...", + "success": true +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/template/permissions.ts b/packages/plugin-injective/injective-sdk-client-ts/src/template/permissions.ts new file mode 100644 index 00000000000..5edf158efd5 --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/template/permissions.ts @@ -0,0 +1,221 @@ +// Permission Module Templates + +export const getAddressesByRoleTemplate = ` +Extract the following details for fetching addresses by role: +- **denom** (string): Token denomination +- **role** (string): Role identifier + +Request format: + +\`\`\`json +{ + "denom": "peggy0x...", + "role": "minter" +} +\`\`\` + +Response will contain an array of addresses: +- **addresses** (array): List of addresses associated with the role + +Response format: + +\`\`\`json +{ + "addresses": [ + "inj1...", + "inj2..." + ] +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getAddressRolesTemplate = ` +Extract the following details for fetching roles by address: +- **address** (string): Account address +- **denom** (string): Token denomination + +Request format: + +\`\`\`json +{ + "address": "inj1...", + "denom": "peggy0x..." +} +\`\`\` + +Response will contain an array of roles: +- **roles** (array): List of roles associated with the address + +Response format: + +\`\`\`json +{ + "roles": [ + "minter", + "burner" + ] +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getAllNamespacesTemplate = ` +Request to fetch all namespaces. No parameters required. + +Response will contain an array of namespace objects: +- **namespaces** (array): List of namespaces containing: + - **denom** (string): Token denomination + - **wasmHook** (string): WASM hook address + - **mintsPaused** (boolean): Minting pause status + - **sendsPaused** (boolean): Sending pause status + - **burnsPaused** (boolean): Burning pause status + - **rolePermissions** (array): List of role permissions + - **addressRoles** (array): List of address roles + +Response format: + +\`\`\`json +{ + "namespaces": [ + { + "denom": "peggy0x...", + "wasmHook": "inj1...", + "mintsPaused": false, + "sendsPaused": false, + "burnsPaused": false, + "rolePermissions": [ + { + "role": "minter", + "permissions": 1 + } + ], + "addressRoles": [ + { + "address": "inj1...", + "roles": ["minter"] + } + ] + } + ] +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getPermissionsModuleParamsTemplate = ` +Request to fetch permission module parameters. No parameters required. + +Response will contain module parameters: +- **wasmHookQueryMaxGas** (string): Maximum gas for WASM hook queries + +Response format: + +\`\`\`json +{ + "wasmHookQueryMaxGas": "1000000" +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getNamespaceByDenomTemplate = ` +Extract the following details for fetching namespace by denomination: +- **denom** (string): Token denomination +- **includeRoles** (boolean): Whether to include role information + +Request format: + +\`\`\`json +{ + "denom": "peggy0x...", + "includeRoles": true +} +\`\`\` + +Response will contain namespace details: +- **namespace** (object): Namespace information containing: + - **denom** (string): Token denomination + - **wasmHook** (string): WASM hook address + - **mintsPaused** (boolean): Minting pause status + - **sendsPaused** (boolean): Sending pause status + - **burnsPaused** (boolean): Burning pause status + - **rolePermissions** (array): Optional list of role permissions if includeRoles is true + - **addressRoles** (array): Optional list of address roles if includeRoles is true + +Response format: + +\`\`\`json +{ + "namespace": { + "denom": "peggy0x...", + "wasmHook": "inj1...", + "mintsPaused": false, + "sendsPaused": false, + "burnsPaused": false, + "rolePermissions": [ + { + "role": "minter", + "permissions": 1 + } + ], + "addressRoles": [ + { + "address": "inj1...", + "roles": ["minter"] + } + ] + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getVouchersForAddressTemplate = ` +Extract the following details for fetching vouchers by address: +- **address** (string): Account address + +Request format: + +\`\`\`json +{ + "address": "inj1..." +} +\`\`\` + +Response will contain array of vouchers: +- **vouchers** (array): List of voucher objects containing: + - **coins** (array): List of coin objects containing: + - **amount** (string): Token amount + - **denom** (string): Token denomination + +Response format: + +\`\`\`json +{ + "vouchers": [ + { + "coins": [ + { + "amount": "1000000000000000000", + "denom": "peggy0x..." + } + ] + } + ] +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/template/staking.ts b/packages/plugin-injective/injective-sdk-client-ts/src/template/staking.ts new file mode 100644 index 00000000000..d7f4f1e11ba --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/template/staking.ts @@ -0,0 +1,664 @@ +// Staking Module Templates Aligned with Actions + +export const getStakingModuleParamsTemplate = ` +Request to fetch staking module parameters. No parameters required. + +Response will contain module parameters: +- **unbondingTime** (number): Time in seconds for unbonding period +- **maxValidators** (number): Maximum number of validators +- **maxEntries** (number): Maximum entries for unbonding delegation +- **historicalEntries** (number): Number of historical entries to persist +- **bondDenom** (string): Native token denomination for staking + +Response format: + +\`\`\`json +{ + "unbondingTime": 1209600, + "maxValidators": 100, + "maxEntries": 7, + "historicalEntries": 10000, + "bondDenom": "inj" +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getPoolTemplate = ` +Request to fetch staking pool information. No parameters required. + +Response will contain pool details: +- **notBondedTokens** (string): Amount of tokens not bonded +- **bondedTokens** (string): Amount of tokens bonded + +Response format: + +\`\`\`json +{ + "notBondedTokens": "1000000000000000000", + "bondedTokens": "5000000000000000000" +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getValidatorsTemplate = ` +Extract the following details for fetching validators: +- **pagination** (object): Optional pagination parameters + - **key** (string): Page key + - **offset** (number): Page offset + - **limit** (number): Page size + - **countTotal** (boolean): Whether to count total + +Request format: + +\`\`\`json +{ + "pagination": { + "key": "abc123...", + "offset": 0, + "limit": 100, + "countTotal": true + } +} +\`\`\` + +Response will contain validator list and pagination details. + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getValidatorTemplate = ` +Extract the following details for fetching a specific validator: +- **address** (string): Validator operator address + +Request format: + +\`\`\`json +{ + "address": "injvaloper1..." +} +\`\`\` + +Response will contain validator details including description, commission rates, and delegation information. + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getValidatorDelegationsTemplate = ` +Extract the following details for fetching validator delegations: +- **validatorAddress** (string): Validator address +- **pagination** (object): Optional pagination parameters + +Request format: + +\`\`\`json +{ + "validatorAddress": "injvaloper1...", + "pagination": { + "key": "abc123...", + "offset": 0, + "limit": 100, + "countTotal": true + } +} +\`\`\` + +Response will contain list of delegations to this validator. + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getValidatorDelegationsNoThrowTemplate = ` +Extract the following details for fetching validator delegations (safe version): +- **validatorAddress** (string): Validator address +- **pagination** (object): Optional pagination parameters + +Request format: + +\`\`\`json +{ + "validatorAddress": "injvaloper1...", + "pagination": { + "key": "abc123...", + "offset": 0, + "limit": 100, + "countTotal": true + } +} +\`\`\` + +Response will contain list of delegations to this validator. This version handles errors gracefully. + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getValidatorUnbondingDelegationsTemplate = ` +Extract the following details for fetching validator unbonding delegations: +- **validatorAddress** (string): Validator address +- **pagination** (object): Optional pagination parameters + +Request format: + +\`\`\`json +{ + "validatorAddress": "injvaloper1...", + "pagination": { + "key": "abc123...", + "offset": 0, + "limit": 100, + "countTotal": true + } +} +\`\`\` + +Response will contain list of unbonding delegations from this validator. + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getValidatorUnbondingDelegationsNoThrowTemplate = ` +Extract the following details for fetching validator unbonding delegations (safe version): +- **validatorAddress** (string): Validator address +- **pagination** (object): Optional pagination parameters + +Request format: + +\`\`\`json +{ + "validatorAddress": "injvaloper1...", + "pagination": { + "key": "abc123...", + "offset": 0, + "limit": 100, + "countTotal": true + } +} +\`\`\` + +Response will contain list of unbonding delegations from this validator. This version handles errors gracefully. + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getDelegationsTemplate = ` +Extract the following details for fetching all delegations: +- **injectiveAddress** (string): Delegator address +- **pagination** (object): Optional pagination parameters + +Request format: + +\`\`\`json +{ + "injectiveAddress": "inj1...", + "pagination": { + "key": "abc123...", + "offset": 0, + "limit": 100, + "countTotal": true + } +} +\`\`\` + +Response will contain list of all delegations for this address. + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getDelegationsNoThrowTemplate = ` +Extract the following details for fetching all delegations (safe version): +- **injectiveAddress** (string): Delegator address +- **pagination** (object): Optional pagination parameters + +Request format: + +\`\`\`json +{ + "injectiveAddress": "inj1...", + "pagination": { + "key": "abc123...", + "offset": 0, + "limit": 100, + "countTotal": true + } +} +\`\`\` + +Response will contain list of all delegations for this address. This version handles errors gracefully. + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getUnbondingDelegationsTemplate = ` +Extract the following details for fetching unbonding delegations: +- **injectiveAddress** (string): Delegator address +- **pagination** (object): Optional pagination parameters + +Request format: + +\`\`\`json +{ + "injectiveAddress": "inj1...", + "pagination": { + "key": "abc123...", + "offset": 0, + "limit": 100, + "countTotal": true + } +} +\`\`\` + +Response will contain list of unbonding delegations for this address. + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getReDelegationsTemplate = ` +Extract the following details for fetching redelegations: +- **injectiveAddress** (string): Delegator address +- **pagination** (object): Optional pagination parameters + +Request format: + +\`\`\`json +{ + "injectiveAddress": "inj1...", + "pagination": { + "key": "abc123...", + "offset": 0, + "limit": 100, + "countTotal": true + } +} +\`\`\` + +Response will contain list of redelegations for this address. + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const msgCreateValidatorTemplate = ` +Extract the following details for creating a validator: +- **moniker** (string): Validator name +- **identity** (string): Optional identity string (e.g., Keybase) +- **website** (string): Optional website URL +- **securityContact** (string): Optional security contact +- **details** (string): Optional validator details +- **rate** (string): Commission rate (e.g., "0.100000000000000000") +- **maxRate** (string): Maximum commission rate +- **maxChangeRate** (string): Maximum commission change rate +- **minSelfDelegation** (string): Minimum self-delegation amount +- **delegatorAddress** (string): Delegator address +- **validatorAddress** (string): Validator address +- **pubkey** (string): Validator public key +- **value** (object): Initial self-delegation + - **denom** (string): Token denomination + - **amount** (string): Token amount + +Request format: + +\`\`\`json +{ + "description": { + "moniker": "Validator Name", + "identity": "keybase-id", + "website": "https://validator.com", + "securityContact": "security@validator.com", + "details": "Validator details" + }, + "commission": { + "rate": "0.100000000000000000", + "maxRate": "0.200000000000000000", + "maxChangeRate": "0.010000000000000000" + }, + "minSelfDelegation": "1000000000000000000", + "delegatorAddress": "inj1...", + "validatorAddress": "injvaloper1...", + "pubkey": "injvalconspub1...", + "value": { + "denom": "inj", + "amount": "1000000000000000000" + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const msgEditValidatorTemplate = ` +Extract the following details for editing a validator: +- **description** (object): Updated validator description + - **moniker** (string): Optional new validator name + - **identity** (string): Optional new identity string + - **website** (string): Optional new website URL + - **securityContact** (string): Optional new security contact + - **details** (string): Optional new validator details +- **validatorAddress** (string): Validator address +- **commissionRate** (string): Optional new commission rate +- **minSelfDelegation** (string): Optional new minimum self-delegation amount + +Request format: + +\`\`\`json +{ + "description": { + "moniker": "New Validator Name", + "identity": "new-keybase-id", + "website": "https://new-website.com", + "securityContact": "new-security@validator.com", + "details": "Updated validator details" + }, + "validatorAddress": "injvaloper1...", + "commissionRate": "0.150000000000000000", + "minSelfDelegation": "2000000000000000000" +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const msgDelegateTemplate = ` +Extract the following details for delegating tokens: +- **delegatorAddress** (string): Delegator address +- **validatorAddress** (string): Validator address +- **amount** (object): Delegation amount + - **denom** (string): Token denomination + - **amount** (string): Token amount + +Request format: + +\`\`\`json +{ + "delegatorAddress": "inj1...", + "validatorAddress": "injvaloper1...", + "amount": { + "denom": "inj", + "amount": "1000000000000000000" + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const msgBeginRedelegateTemplate = ` +Extract the following details for beginning a redelegation: +- **delegatorAddress** (string): Delegator address +- **validatorSrcAddress** (string): Source validator address +- **validatorDstAddress** (string): Destination validator address +- **amount** (object): Amount to redelegate + - **denom** (string): Token denomination + - **amount** (string): Token amount + +Request format: + +\`\`\`json +{ + "delegatorAddress": "inj1...", + "validatorSrcAddress": "injvaloper1...", + "validatorDstAddress": "injvaloper2...", + "amount": { + "denom": "inj", + "amount": "1000000000000000000" + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +// Staking Module Templates - Part 2 (Message Templates Continued) + +export const msgUndelegateTemplate = ` +Extract the following details for undelegating tokens: +- **delegatorAddress** (string): Delegator address +- **validatorAddress** (string): Validator address +- **amount** (object): Amount to undelegate + - **denom** (string): Token denomination + - **amount** (string): Token amount + +Request format: + +\`\`\`json +{ + "delegatorAddress": "inj1...", + "validatorAddress": "injvaloper1...", + "amount": { + "denom": "inj", + "amount": "1000000000000000000" + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const msgCancelUnbondingDelegationTemplate = ` +Extract the following details for canceling an unbonding delegation: +- **delegatorAddress** (string): Delegator address +- **validatorAddress** (string): Validator address +- **amount** (object): Amount to cancel unbonding + - **denom** (string): Token denomination + - **amount** (string): Token amount +- **creationHeight** (number): Original unbonding creation height + +Request format: + +\`\`\`json +{ + "delegatorAddress": "inj1...", + "validatorAddress": "injvaloper1...", + "amount": { + "denom": "inj", + "amount": "1000000000000000000" + }, + "creationHeight": 1000000 +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getDelegationTemplate = ` +Extract the following details for fetching a specific delegation: +- **injectiveAddress** (string): Delegator address +- **validatorAddress** (string): Validator address + +Request format: + +\`\`\`json +{ + "injectiveAddress": "inj1...", + "validatorAddress": "injvaloper1..." +} +\`\`\` + +Response will contain delegation details: +- **delegation** (object): Delegation information + - **delegatorAddress** (string): Delegator address + - **validatorAddress** (string): Validator address + - **shares** (string): Delegation shares +- **balance** (object): Balance information + - **denom** (string): Token denomination + - **amount** (string): Token amount + +Response format: + +\`\`\`json +{ + "delegation": { + "delegatorAddress": "inj1...", + "validatorAddress": "injvaloper1...", + "shares": "1000000000000000000" + }, + "balance": { + "denom": "inj", + "amount": "1000000000000000000" + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getDelegatorsTemplate = ` +Extract the following details for fetching all delegators of a validator: +- **validatorAddress** (string): Validator address +- **pagination** (object): Optional pagination parameters + - **key** (string): Page key + - **offset** (number): Page offset + - **limit** (number): Page size + - **countTotal** (boolean): Whether to count total + +Request format: + +\`\`\`json +{ + "validatorAddress": "injvaloper1...", + "pagination": { + "key": "abc123...", + "offset": 0, + "limit": 100, + "countTotal": true + } +} +\`\`\` + +Response will contain delegations and pagination: +- **delegations** (array): List of delegations +- **pagination** (object): Pagination information + - **nextKey** (string): Next page key + - **total** (string): Total count if requested + +Response format: + +\`\`\`json +{ + "delegations": [ + { + "delegation": { + "delegatorAddress": "inj1...", + "validatorAddress": "injvaloper1...", + "shares": "1000000000000000000" + }, + "balance": { + "denom": "inj", + "amount": "1000000000000000000" + } + } + ], + "pagination": { + "nextKey": "xyz789...", + "total": "50" + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +// Template for NoThrow versions (handling errors gracefully) +export const getDelegatorsNoThrowTemplate = ` +Extract the following details for fetching all delegators (safe version): +- **validatorAddress** (string): Validator address +- **pagination** (object): Optional pagination parameters + - **key** (string): Page key + - **offset** (number): Page offset + - **limit** (number): Page size + - **countTotal** (boolean): Whether to count total + +Request format: + +\`\`\`json +{ + "validatorAddress": "injvaloper1...", + "pagination": { + "key": "abc123...", + "offset": 0, + "limit": 100, + "countTotal": true + } +} +\`\`\` + +Response will contain delegations and pagination (same format as getDelegatorsTemplate). +This version handles errors gracefully and won't throw exceptions. + +Here are the recent user messages for context: +{{recentMessages}} +`; + +// Additional NoThrow templates for other endpoints +export const getUnbondingDelegationsNoThrowTemplate = ` +Extract the following details for fetching unbonding delegations (safe version): +- **injectiveAddress** (string): Delegator address +- **pagination** (object): Optional pagination parameters + +Request format: + +\`\`\`json +{ + "injectiveAddress": "inj1...", + "pagination": { + "key": "abc123...", + "offset": 0, + "limit": 100, + "countTotal": true + } +} +\`\`\` + +Response will contain list of unbonding delegations. +This version handles errors gracefully and won't throw exceptions. + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getReDelegationsNoThrowTemplate = ` +Extract the following details for fetching redelegations (safe version): +- **injectiveAddress** (string): Delegator address +- **pagination** (object): Optional pagination parameters + +Request format: + +\`\`\`json +{ + "injectiveAddress": "inj1...", + "pagination": { + "key": "abc123...", + "offset": 0, + "limit": 100, + "countTotal": true + } +} +\`\`\` + +Response will contain list of redelegations. +This version handles errors gracefully and won't throw exceptions. + +Here are the recent user messages for context: +{{recentMessages}} +`; diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/template/token-factory.ts b/packages/plugin-injective/injective-sdk-client-ts/src/template/token-factory.ts new file mode 100644 index 00000000000..1f9679f6a08 --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/template/token-factory.ts @@ -0,0 +1,227 @@ +// Token Factory Module Templates + +export const getDenomsFromCreatorTemplate = ` +Extract the following details for fetching denominations from creator: +- **creator** (string): Creator's address + +Request format: + +\`\`\`json +{ + "creator": "inj1..." +} +\`\`\` + +Response will contain an array of denominations: +- **denoms** (array): List of denomination strings + +Response format: + +\`\`\`json +{ + "denoms": [ + "factory/inj1.../token1", + "factory/inj1.../token2" + ] +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getDenomAuthorityMetadataTemplate = ` +Extract the following details for fetching denomination authority metadata: +- **creator** (string): Creator's address +- **subDenom** (string): Sub-denomination identifier + +Request format: + +\`\`\`json +{ + "creator": "inj1...", + "subDenom": "token1" +} +\`\`\` + +Response will contain authority metadata: +- **authorityMetadata** (object): Authority metadata information + - **admin** (string): Admin address (can be undefined) + +Response format: + +\`\`\`json +{ + "authorityMetadata": { + "admin": "inj1..." + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getTokenFactoryModuleParamsTemplate = ` +Request to fetch token factory module parameters. No parameters required. + +Response will contain module parameters: +- **denomCreationFee** (array): Array of creation fee coins + - **denom** (string): Token denomination + - **amount** (string): Fee amount + +Response format: + +\`\`\`json +{ + "denomCreationFee": [ + { + "denom": "inj", + "amount": "1000000000000000000" + } + ] +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getTokenFactoryModuleStateTemplate = ` +Request to fetch token factory module state. No parameters required. + +Response will contain module state: +- **denomCreationFee** (array): Array of creation fee coins + - **denom** (string): Token denomination + - **amount** (string): Fee amount +- **factoryDenoms** (array): List of factory denominations with metadata + - **denom** (string): Full denomination string + - **authorityMetadata** (object): Authority metadata + - **admin** (string): Admin address + +Response format: + +\`\`\`json +{ + "denomCreationFee": [ + { + "denom": "inj", + "amount": "1000000000000000000" + } + ], + "factoryDenoms": [ + { + "denom": "factory/inj1.../token1", + "authorityMetadata": { + "admin": "inj1..." + } + } + ] +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const msgBurnTemplate = ` +Extract the following details for burning tokens: +- **amount** (object): Amount to burn + - **denom** (string): Token denomination + - **amount** (string): Token amount + +Request format: + +\`\`\`json +{ + "amount": { + "denom": "factory/inj1.../token1", + "amount": "1000000000000000000" + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const msgChangeAdminTemplate = ` +Extract the following details for changing token admin: +- **denom** (string): Token denomination +- **newAdmin** (string): New admin address + +Request format: + +\`\`\`json +{ + "denom": "factory/inj1.../token1", + "newAdmin": "inj1..." +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const msgCreateDenomTemplate = ` +Extract the following details for creating a new denomination: +- **subDenom** (string): Sub-denomination identifier + +Request format: + +\`\`\`json +{ + "subDenom": "token1" +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const msgMintTemplate = ` +Extract the following details for minting tokens: +- **totalAmount** (object): Amount to mint + - **denom** (string): Token denomination + - **amount** (string): Token amount + +Request format: + +\`\`\`json +{ + "totalAmount": { + "denom": "factory/inj1.../token1", + "amount": "1000000000000000000" + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const msgSetDenomMetadataTemplate = ` +Extract the following details for setting denomination metadata: +- **description** (string): Token description +- **denom** (string): Token denomination +- **name** (string): Token name +- **symbol** (string): Token symbol +- **uri** (string): Project URI +- **uriHash** (string): URI hash + +Request format: + +\`\`\`json +{ + "description": "Example Token", + "denom": "factory/inj1.../token1", + "name": "Example Token", + "symbol": "EXT", + "uri": "https://example.com", + "uriHash": "hash123" +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/template/wasm.ts b/packages/plugin-injective/injective-sdk-client-ts/src/template/wasm.ts new file mode 100644 index 00000000000..99e882a0e4e --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/template/wasm.ts @@ -0,0 +1,848 @@ +// WASM and WasmX Module Templates + +// WasmX Module Templates + +export const getWasmxModuleParamsTemplate = ` +Request to fetch WasmX module parameters. No parameters required. + +Response will contain module parameters as per the WasmX params structure: +- **params** (object): Module parameters and settings + +Response format: + +\`\`\`json +{ + "params": { + "is_execution_enabled": true, + "registration_fee": { + "denom": "inj", + "amount": "100000000000000000000" + }, + "max_begin_block_tx_gas": 1000000, + "max_contract_gas_limit": 500000, + "min_gas_price": "1000000000" + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getWasmxModuleStateTemplate = ` +Request to fetch WasmX module state. No parameters required. + +Response will contain the complete module state: +- **params** (object): Module parameters +- **registered_contracts** (array): List of registered contracts + - **address** (string): Contract address + - **gas_limit** (number): Gas limit + - **gas_price** (string): Gas price + - **is_executable** (boolean): Execution status + - **code_id** (number): Contract code ID + +Response format: + +\`\`\`json +{ + "params": { + "is_execution_enabled": true, + "registration_fee": { + "denom": "inj", + "amount": "100000000000000000000" + }, + "max_begin_block_tx_gas": 1000000, + "max_contract_gas_limit": 500000, + "min_gas_price": "1000000000" + }, + "registered_contracts": [ + { + "address": "inj1...", + "gas_limit": 1000000, + "gas_price": "1000000000", + "is_executable": true, + "code_id": 1 + } + ] +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +// Standard WASM Module Templates + +export const getContractAccountsBalanceTemplate = ` +Extract the following details for fetching contract accounts balance: +- **contractAddress** (string): Contract address +- **pagination** (object): Optional pagination parameters + - **key** (string): Page key + - **offset** (number): Page offset + - **limit** (number): Page size + - **countTotal** (boolean): Whether to count total + +Request format: + +\`\`\`json +{ + "contractAddress": "inj1...", + "pagination": { + "key": "abc123...", + "offset": 0, + "limit": 100, + "countTotal": true + } +} +\`\`\` + +Response will contain contract balances and information: +- **tokenInfo** (object): Token information + - **name** (string): Token name + - **symbol** (string): Token symbol + - **decimals** (number): Token decimals + - **total_supply** (string): Total supply + - **mint** (string): Mint address +- **contractInfo** (object): Contract information + - **codeId** (number): Code ID + - **creator** (string): Creator address + - **admin** (string): Admin address + - **label** (string): Contract label +- **marketingInfo** (object): Marketing information + - **project** (string): Project name + - **description** (string): Project description + - **logo** (object): Logo information + - **url** (string): Logo URL + - **marketing** (string): Marketing info +- **contractAccountsBalance** (array): List of account balances + - **account** (string): Account address + - **balance** (string): Account balance + +Response format: + +\`\`\`json +{ + "tokenInfo": { + "name": "Example Token", + "symbol": "EXT", + "decimals": 18, + "total_supply": "1000000000000000000000000", + "mint": "inj1..." + }, + "contractInfo": { + "codeId": 1, + "creator": "inj1...", + "admin": "inj1...", + "label": "Example Contract" + }, + "marketingInfo": { + "project": "Example Project", + "description": "Example Description", + "logo": { + "url": "https://example.com/logo.png" + }, + "marketing": "Example Marketing Info" + }, + "contractAccountsBalance": [ + { + "account": "inj1...", + "balance": "1000000000000000000" + } + ], + "pagination": { + "nextKey": "xyz789...", + "total": "100" + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getContractStateTemplate = ` +Extract the following details for fetching contract state: +- **contractAddress** (string): Contract address +- **pagination** (object): Optional pagination parameters + +Request format: + +\`\`\`json +{ + "contractAddress": "inj1...", + "pagination": { + "key": "abc123...", + "offset": 0, + "limit": 100, + "countTotal": true + } +} +\`\`\` + +Response will contain contract state with same structure as getContractAccountsBalanceTemplate. + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getContractInfoTemplate = ` +Extract the following details for fetching contract information: +- **contractAddress** (string): Contract address + +Request format: + +\`\`\`json +{ + "contractAddress": "inj1..." +} +\`\`\` + +Response will contain contract information: +- **codeId** (number): Code ID +- **creator** (string): Creator address +- **admin** (string): Admin address +- **label** (string): Contract label +- **created** (object): Creation information + - **blockHeight** (number): Block height + - **txIndex** (number): Transaction index +- **ibcPortId** (string): IBC port ID +- **extension** (object): Optional extension data + +Response format: + +\`\`\`json +{ + "codeId": 1, + "creator": "inj1...", + "admin": "inj1...", + "label": "Example Contract", + "created": { + "blockHeight": 1000000, + "txIndex": 0 + }, + "ibcPortId": "wasm.1", + "extension": { + "typeUrl": "example", + "value": "base64encodeddata" + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getContractHistoryTemplate = ` +Extract the following details for fetching contract history: +- **contractAddress** (string): Contract address + +Request format: + +\`\`\`json +{ + "contractAddress": "inj1..." +} +\`\`\` + +Response will contain contract history: +- **entriesList** (array): List of history entries + - **operation** (string): Operation type + - **codeId** (number): Code ID + - **updated** (object): Update information + - **blockHeight** (number): Block height + - **txIndex** (number): Transaction index + - **msg** (string): Operation message +- **pagination** (object): Pagination information + +Response format: + +\`\`\`json +{ + "entriesList": [ + { + "operation": "CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT", + "codeId": 1, + "updated": { + "blockHeight": 1000000, + "txIndex": 0 + }, + "msg": "base64encodeddata" + } + ], + "pagination": { + "nextKey": "xyz789...", + "total": "10" + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getSmartContractStateTemplate = ` +Extract the following details for fetching smart contract state: +- **contractAddress** (string): Contract address +- **query** (string or object): Query parameters + +Request format: + +\`\`\`json +{ + "contractAddress": "inj1...", + "query": { + "get_state": {} + } +} +\`\`\` + +Response will contain contract-specific state data. + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getRawContractStateTemplate = ` +Extract the following details for fetching raw contract state: +- **contractAddress** (string): Contract address +- **query** (string): Query key + +Request format: + +\`\`\`json +{ + "contractAddress": "inj1...", + "query": "base64encodedkey" +} +\`\`\` + +Response will contain raw contract state data. + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getContractCodesTemplate = ` +Extract the following details for fetching contract codes: +- **pagination** (object): Optional pagination parameters + +Request format: + +\`\`\`json +{ + "pagination": { + "key": "abc123...", + "offset": 0, + "limit": 100, + "countTotal": true + } +} +\`\`\` + +Response will contain list of code information: +- **codeInfosList** (array): List of code information + - **codeId** (number): Code ID + - **creator** (string): Creator address + - **dataHash** (string): Code data hash +- **pagination** (object): Pagination information + +Response format: + +\`\`\`json +{ + "codeInfosList": [ + { + "codeId": 1, + "creator": "inj1...", + "dataHash": "base64encodeddata" + } + ], + "pagination": { + "nextKey": "xyz789...", + "total": "50" + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getContractCodeTemplate = ` +Extract the following details for fetching contract code: +- **codeId** (number): Code ID + +Request format: + +\`\`\`json +{ + "codeId": 1 +} +\`\`\` + +Response will contain code information and data: +- **codeInfo** (object): Code information + - **codeId** (number): Code ID + - **creator** (string): Creator address + - **dataHash** (string): Code data hash +- **data** (string): Base64 encoded WASM bytecode + +Response format: + +\`\`\`json +{ + "codeInfo": { + "codeId": 1, + "creator": "inj1...", + "dataHash": "base64encodeddata" + }, + "data": "base64encodedwasmcode" +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getContractCodeContractsTemplate = ` +Extract the following details for fetching contracts by code ID: +- **codeId** (number): Code ID +- **pagination** (object): Optional pagination parameters + +Request format: + +\`\`\`json +{ + "codeId": 1, + "pagination": { + "key": "abc123...", + "offset": 0, + "limit": 100, + "countTotal": true + } +} +\`\`\` + +Response will contain list of contracts: +- **contractsList** (array): List of contract addresses +- **pagination** (object): Pagination information + +Response format: + +\`\`\`json +{ + "contractsList": [ + "inj1...", + "inj2..." + ], + "pagination": { + "nextKey": "xyz789...", + "total": "20" + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +// Message Templates + +export const msgStoreCodeTemplate = ` +Extract the following details for storing contract code: +- **sender** (string): Sender address +- **wasmByteCode** (string): Base64 encoded WASM bytecode +- **instantiatePermission** (object): Optional instantiation permission + - **permission** (string): Permission type + - **address** (string): Restricted address + +Request format: + +\`\`\`json +{ + "sender": "inj1...", + "wasmByteCode": "base64encodedwasmcode", + "instantiatePermission": { + "permission": "Everybody", + "address": "" + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const msgUpdateAdminTemplate = ` +Extract the following details for updating contract admin: +- **sender** (string): Current admin address +- **newAdmin** (string): New admin address +- **contract** (string): Contract address + +Request format: + +\`\`\`json +{ + "sender": "inj1...", + "newAdmin": "inj2...", + "contract": "inj3..." +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const msgExecuteContractTemplate = ` +Extract the following details for executing contract: +- **sender** (string): Sender address +- **contract** (string): Contract address +- **msg** (string or object): Execute message +- **funds** (array): Optional funds to send + - **denom** (string): Token denomination + - **amount** (string): Token amount + +Request format: + +\`\`\`json +{ + "sender": "inj1...", + "contract": "inj2...", + "msg": { + "execute": { + "action": "transfer", + "amount": "1000000000000000000", + "recipient": "inj3..." + } + }, + "funds": [ + { + "denom": "inj", + "amount": "1000000000000000000" + } + ] +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const msgMigrateContractTemplate = ` +Extract the following details for migrating contract: +- **sender** (string): Admin address +- **contract** (string): Contract address +- **codeId** (number): New code ID +- **msg** (string or object): Migration message + +Request format: + +\`\`\`json +{ + "sender": "inj1...", + "contract": "inj2...", + "codeId": 2, + "msg": { + "migrate": { + "new_parameter": "value" + } + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const msgInstantiateContractTemplate = ` +Extract the following details for instantiating contract: +- **sender** (string): Sender address +- **admin** (string): Optional admin address +- **codeId** (number): Code ID to instantiate +- **label** (string): Contract label +- **msg** (object): Instantiation message +- **funds** (array): Optional funds to send + - **denom** (string): Token denomination + - **amount** (string): Token amount + +Request format: + +\`\`\`json +{ + "sender": "inj1...", + "admin": "inj2...", + "codeId": 1, + "label": "Example Contract", + "msg": { + "name": "Example Token", + "symbol": "EXT", + "decimals": 18, + "initial_balances": [ + { + "address": "inj3...", + "amount": "1000000000000000000000000" + } + ] + }, + "funds": [ + { + "denom": "inj", + "amount": "1000000000000000000" + } + ] +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const msgExecuteContractCompatTemplate = ` +Extract the following details for executing contract in compatibility mode: +- **sender** (string): Sender address +- **contract** (string): Contract address +- **msg** (object): Execute message in compatibility format +- **funds** (array): Optional funds to send + - **denom** (string): Token denomination + - **amount** (string): Token amount + +Request format: + +\`\`\`json +{ + "sender": "inj1...", + "contract": "inj2...", + "msg": { + "send": { + "to": "inj3...", + "amount": "1000000000000000000" + } + }, + "funds": [ + { + "denom": "inj", + "amount": "1000000000000000000" + } + ] +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const msgPrivilegedExecuteContractTemplate = ` +Extract the following details for privileged contract execution: +- **sender** (string): Privileged sender address +- **contract** (string): Contract address +- **msg** (object): Privileged execute message + +Request format: + +\`\`\`json +{ + "sender": "inj1...", + "contract": "inj2...", + "msg": { + "privileged_action": { + "parameter": "value" + } + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +// Additional Query Templates for Contract State + +export const getContractStateByKeyTemplate = ` +Extract the following details for fetching contract state by key: +- **contractAddress** (string): Contract address +- **key** (string): State key in base64 format + +Request format: + +\`\`\`json +{ + "contractAddress": "inj1...", + "key": "base64encodedkey" +} +\`\`\` + +Response will contain state value for the given key in base64 format. + +Response format: + +\`\`\`json +{ + "data": "base64encodedvalue" +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getContractHistoryByOperationTemplate = ` +Extract the following details for fetching contract history by operation type: +- **contractAddress** (string): Contract address +- **operationType** (string): Operation type (Init/Migrate/Genesis) + +Request format: + +\`\`\`json +{ + "contractAddress": "inj1...", + "operationType": "Init" +} +\`\`\` + +Response will contain filtered history entries: +- **entries** (array): List of history entries matching the operation type + - **operation** (string): Operation type + - **codeId** (number): Code ID + - **updated** (object): Update information + - **blockHeight** (number): Block height + - **txIndex** (number): Transaction index + - **msg** (string): Operation message + +Response format: + +\`\`\`json +{ + "entries": [ + { + "operation": "Init", + "codeId": 1, + "updated": { + "blockHeight": 1000000, + "txIndex": 0 + }, + "msg": "base64encodeddata" + } + ] +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +export const getContractCodeHistoryTemplate = ` +Extract the following details for fetching complete contract code history: +- **contractAddress** (string): Contract address +- **pagination** (object): Optional pagination parameters + +Request format: + +\`\`\`json +{ + "contractAddress": "inj1...", + "pagination": { + "key": "abc123...", + "offset": 0, + "limit": 100, + "countTotal": true + } +} +\`\`\` + +Response will contain complete code history: +- **history** (array): List of all code changes + - **codeId** (number): Code ID + - **timeStamp** (string): Change timestamp + - **operation** (string): Operation type + - **msg** (string): Operation message + - **initiator** (string): Change initiator address +- **pagination** (object): Pagination information + +Response format: + +\`\`\`json +{ + "history": [ + { + "codeId": 1, + "timeStamp": "2024-01-01T00:00:00Z", + "operation": "Init", + "msg": "base64encodeddata", + "initiator": "inj1..." + } + ], + "pagination": { + "nextKey": "xyz789...", + "total": "10" + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; + +// Templates for Contract Events and Logs + +export const getContractEventsTemplate = ` +Extract the following details for fetching contract events: +- **contractAddress** (string): Contract address +- **eventType** (string): Optional event type filter +- **pagination** (object): Optional pagination parameters + +Request format: + +\`\`\`json +{ + "contractAddress": "inj1...", + "eventType": "wasm", + "pagination": { + "key": "abc123...", + "offset": 0, + "limit": 100, + "countTotal": true + } +} +\`\`\` + +Response will contain contract events: +- **events** (array): List of contract events + - **type** (string): Event type + - **attributes** (array): Event attributes + - **key** (string): Attribute key + - **value** (string): Attribute value + - **blockHeight** (number): Block height + - **txHash** (string): Transaction hash +- **pagination** (object): Pagination information + +Response format: + +\`\`\`json +{ + "events": [ + { + "type": "wasm", + "attributes": [ + { + "key": "action", + "value": "transfer" + }, + { + "key": "amount", + "value": "1000000000000000000" + } + ], + "blockHeight": 1000000, + "txHash": "0x..." + } + ], + "pagination": { + "nextKey": "xyz789...", + "total": "100" + } +} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/types/auction.ts b/packages/plugin-injective/injective-sdk-client-ts/src/types/auction.ts new file mode 100644 index 00000000000..ae8601a51f0 --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/types/auction.ts @@ -0,0 +1,13 @@ +//Auction Module Params +export interface MsgBidRequestParams { + amount: string; + round: number; +} +export interface GetAuctionRoundParams { + round: number; +} + +export interface GetAuctionsParams { + startRound: number; + limit: number; +} diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/types/auth.ts b/packages/plugin-injective/injective-sdk-client-ts/src/types/auth.ts new file mode 100644 index 00000000000..5f9c4acd8e4 --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/types/auth.ts @@ -0,0 +1,60 @@ +import { + PaginationOption, + GrantWithDecodedAuthorization, + GrantAuthorizationWithDecodedAuthorization, + Pagination, + Msgs, +} from "@injectivelabs/sdk-ts"; +import { AddressParams } from "./base"; +// Auth Module Params +// Start of Get Auth Module Request Parameters +export interface AuthAccountParams extends AddressParams { + accountAddress: string; +} +export interface GetGrantsParams { + granter: string; + grantee: string; + pagination?: PaginationOption; +} + +export interface GetGranterGrantsParams { + granter: string; + pagination?: PaginationOption; +} + +export interface GetGranteeGrantsParams { + grantee: string; + pagination?: PaginationOption; +} +export interface MsgGrantParams { + messageType: string; + grantee: string; + granter: string; +} + +export interface MsgAuthzExecParams { + grantee: string; + msgs: Msgs | Msgs[]; +} +export interface MsgRevokeParams { + messageType: string; + grantee: string; + granter: string; +} +// End of Get Auth Module Request Parameters +// Start of Auth Response Parameters +export interface GrantsResponse { + pagination: Pagination; + grants: GrantWithDecodedAuthorization[]; +} + +export interface GranterGrantsResponse { + pagination: Pagination; + grants: GrantAuthorizationWithDecodedAuthorization[]; +} + +export interface GranteeGrantsResponse { + pagination: Pagination; + grants: GrantAuthorizationWithDecodedAuthorization[]; +} +// End of Auth Response Parameters diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/types/bank.ts b/packages/plugin-injective/injective-sdk-client-ts/src/types/bank.ts new file mode 100644 index 00000000000..8fb6b2c8a1f --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/types/bank.ts @@ -0,0 +1,99 @@ +import { PaginationOption, Pagination, Coin } from "@injectivelabs/sdk-ts"; +import { CosmosBaseV1Beta1Coin } from "@injectivelabs/core-proto-ts"; +import { DenomParam } from "./base"; +// Bank Module Params +// Start of Get Bank Request Parameters +export interface GetBankBalanceParams { + denom: string; +} + +export interface GetBankBalancesParams { + pagination?: PaginationOption; +} + +export interface GetSupplyOfParams { + denom: string; +} + +export interface GetDenomMetadataParams { + denom: string; +} + +export interface GetDenomOwnersParams { + denom: string; +} + +export interface BankBalanceParams { + accountAddress: string; + denom: string; +} + +export interface MsgSendParams { + amount: + | { + denom: string; + amount: string; + } + | { + denom: string; + amount: string; + }[]; + srcInjectiveAddress: string; + dstInjectiveAddress: string; +} + +export interface MsgMultiSendParams { + inputs: { + address: string; + coins: CosmosBaseV1Beta1Coin.Coin[]; + }[]; + outputs: { + address: string; + coins: CosmosBaseV1Beta1Coin.Coin[]; + }[]; +} +// End of Get Bank Module Parameters +// Start of Bank Module Response Parameters +export interface BankModuleParamsResponse { + params: any; // Replace 'any' with actual params type from your SDK +} + +export interface BankBalanceResponse { + balance: Coin; +} + +export interface BankBalancesResponse { + balances: Coin[]; + pagination: Pagination; +} + +export interface TotalSupplyResponse { + supply: { denom: string; amount: string }[]; + pagination: Pagination; +} + +export interface SupplyOfResponse { + amount: Coin; +} + +export interface DenomsMetadataResponse { + metadatas: Metadata[]; + pagination: Pagination; +} + +export interface DenomMetadataResponse { + metadata: Metadata; +} + +export interface DenomOwnersResponse { + denomOwners: { + address: string; + balance: Coin | undefined; + }[]; + pagination: Pagination; +} + +export interface DenomMetadataParams extends DenomParam {} + +export interface DenomOwnerParams extends DenomParam {} +// End of Bank Module Response parameters diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/types/base.ts b/packages/plugin-injective/injective-sdk-client-ts/src/types/base.ts new file mode 100644 index 00000000000..2e7da0044af --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/types/base.ts @@ -0,0 +1,17 @@ +import { PaginationOption } from "@injectivelabs/sdk-ts"; +export interface PaginationParams { + pagination?: PaginationOption; +} +export interface PaginationParams { + pagination?: PaginationOption; +} +export interface AddressParams { + address: string; +} +export interface TimeRangeParams { + startTime?: number; + endTime?: number; +} +export interface DenomParam { + denom: string; +} diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/types/distribution.ts b/packages/plugin-injective/injective-sdk-client-ts/src/types/distribution.ts new file mode 100644 index 00000000000..60750f0ef80 --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/types/distribution.ts @@ -0,0 +1,41 @@ +// Distribution Module Params +// Start of Get Distribution Module Parameters + +import { + DistributionModuleParams, + ValidatorRewards, + Coin, +} from "@injectivelabs/sdk-ts"; +export interface DelegatorValidatorParams { + delegatorAddress: string; + validatorAddress: string; +} +export interface MsgWithdrawDelegatorRewardParams { + delegatorAddress: string; + validatorAddress: string; +} +export interface MsgWithdrawValidatorCommissionParams { + validatorAddress: string; +} +export interface GetDelegatorRewardsForValidatorParams { + delegatorAddress: string; + validatorAddress: string; +} + +export interface GetDelegatorRewardsParams { + injectiveAddress: string; +} +// End of Get Distribution Module Request parameters +// Start of Distribution Module Response +export interface DistributionModuleParamsResponse { + params: DistributionModuleParams; +} + +export interface DelegatorRewardsForValidatorResponse { + rewards: Coin[]; +} + +export interface DelegatorRewardsResponse { + rewards: ValidatorRewards[]; +} +// End of Distribution Module Response parameters diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/types/exchange.ts b/packages/plugin-injective/injective-sdk-client-ts/src/types/exchange.ts new file mode 100644 index 00000000000..4d8a5f5307c --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/types/exchange.ts @@ -0,0 +1,659 @@ +import { + PaginationOption, + TradeDirection, + TradeExecutionType, + TradeExecutionSide, + GrpcMarketStatus, + MarketType, + GridStrategyType, +} from "@injectivelabs/sdk-ts"; +import { PaginationParams, TimeRangeParams } from "./base"; +import { + InjectiveExchangeV1Beta1Exchange, + InjectiveOracleV1Beta1Oracle, +} from "@injectivelabs/core-proto-ts"; +import { OrderSide, OrderState } from "@injectivelabs/ts-types"; + +export interface MarketIdParam { + marketId: string; +} + +export interface SubaccountIdParam { + subaccountId: string; +} +// Exchange Module +// Start of Get Exchange Module Params +export interface GetModuleParamsParams {} + +export interface GetModuleStateParams {} + +export interface GetFeeDiscountScheduleParams {} + +export interface GetFeeDiscountAccountInfoParams { + injAddress: string; +} + +export interface GetTradingRewardsCampaignParams {} + +export interface GetTradeRewardPointsParams { + injectiveAddresses: string[]; +} + +export interface GetPendingTradeRewardPointsParams { + injectiveAddresses: string[]; +} + +export interface GetExchangePositionsParams {} + +export interface GetSubaccountTradeNonceParams { + subaccountId: string; +} + +export interface GetIsOptedOutOfRewardsParams { + account: string; +} + +export interface GetDerivativeMarketsParams { + quoteDenom?: string; + marketStatus?: string; + marketStatuses?: string[]; +} + +export interface GetDerivativeMarketParams { + marketId: string; +} + +export interface GetBinaryOptionsMarketsParams { + marketStatus?: string; + quoteDenom?: string; + pagination?: PaginationOption; +} + +export interface GetBinaryOptionsMarketParams { + marketId: string; +} + +export interface GetDerivativeOrdersParams { + marketId?: string; + marketIds?: string[]; + orderSide?: OrderSide; + isConditional?: boolean; + subaccountId?: string; + pagination?: PaginationOption; +} + +export interface GetDerivativeOrderHistoryParams { + subaccountId?: string; + marketId?: string; + marketIds?: string[]; + orderTypes?: OrderSide[]; + executionTypes?: TradeExecutionType[]; + direction?: TradeDirection; + isConditional?: boolean; + state?: OrderState; + pagination?: PaginationOption; +} + +export interface GetPositionsParams { + marketId?: string; + marketIds?: string[]; + subaccountId?: string; + direction?: TradeDirection; + pagination?: PaginationOption; +} + +export interface GetPositionsV2Params { + address?: string; + marketId?: string; + marketIds?: string[]; + subaccountId?: string; + direction?: TradeDirection; + pagination?: PaginationOption; +} + +export interface GetDerivativeTradesParams { + endTime?: number; + tradeId?: string; + marketId?: string; + startTime?: number; + marketIds?: string[]; + subaccountId?: string; + accountAddress?: string; + direction?: TradeDirection; + pagination?: PaginationOption; + executionSide?: TradeExecutionSide; + executionTypes?: TradeExecutionType[]; +} + +export interface GetFundingPaymentsParams { + marketId?: string; + marketIds?: string[]; + subaccountId?: string; + pagination?: PaginationOption; +} + +export interface GetFundingRatesParams { + marketId?: string; + pagination?: PaginationOption; +} + +export interface GetDerivativeSubaccountOrdersListParams { + marketId?: string; + subaccountId?: string; + pagination?: PaginationOption; +} + +export interface GetDerivativeSubaccountTradesListParams { + marketId?: string; + subaccountId?: string; + direction?: TradeDirection; + executionType?: TradeExecutionType; + pagination?: PaginationOption; +} + +export interface GetDerivativeOrderbooksV2Params { + marketIds: string[]; +} + +export interface GetDerivativeOrderbookV2Params { + marketId: string; +} + +export interface GetRewardsParams { + address: string; + epoch: number; +} + +export interface GetSubaccountsListParams { + address: string; +} + +export interface GetSubaccountBalancesListParams { + subaccountId: string; +} + +export interface GetSubaccountHistoryParams { + subaccountId: string; + denom?: string; + transferTypes?: string[]; + pagination?: PaginationOption; +} + +export interface GetSubaccountOrderSummaryParams { + subaccountId: string; + marketId?: string; + orderDirection?: string; +} + +export interface GetOrderStatesParams { + spotOrderHashes?: string[]; + derivativeOrderHashes?: string[]; +} + +export interface GetAccountPortfolioParams { + address: string; +} + +export interface GetAccountPortfolioBalancesParams { + address: string; +} + +export interface GetSpotMarketsParams { + baseDenom?: string; + marketStatus?: string; + quoteDenom?: string; + marketStatuses?: string[]; +} + +export interface GetSpotMarketParams { + marketId: string; +} + +export interface GetSpotOrdersParams { + marketId?: string; + marketIds?: string[]; + subaccountId?: string; + orderSide?: OrderSide; + isConditional?: boolean; + pagination?: PaginationOption; +} + +export interface GetSpotOrderHistoryParams { + subaccountId?: string; + marketId?: string; + marketIds?: string[]; + orderTypes?: OrderSide[]; + executionTypes?: TradeExecutionType[]; + direction?: TradeDirection; + isConditional?: boolean; + state?: OrderState; + pagination?: PaginationOption; +} + +export interface GetSpotTradesParams { + endTime?: number; + tradeId?: string; + marketId?: string; + startTime?: number; + marketIds?: string[]; + subaccountId?: string; + accountAddress?: string; + direction?: TradeDirection; + pagination?: PaginationOption; + executionSide?: TradeExecutionSide; + executionTypes?: TradeExecutionType[]; +} + +export interface GetSpotSubaccountOrdersListParams { + subaccountId?: string; + marketId?: string; + pagination?: PaginationOption; +} + +export interface GetSpotSubaccountTradesListParams { + subaccountId?: string; + marketId?: string; + direction?: TradeDirection; + executionType?: TradeExecutionType; + pagination?: PaginationOption; +} + +export interface GetSpotOrderbooksV2Params { + marketIds: string[]; +} + +export interface GetSpotOrderbookV2Params { + marketId: string; +} + +export interface GetAtomicSwapHistoryParams { + address: string; + contractAddress: string; + pagination?: PaginationOption; +} + +export interface GetGridStrategiesParams { + accountAddress?: string; + subaccountId?: string; + state?: string; + marketId?: string; + limit?: number; + skip?: number; + marketType?: MarketType; + strategyType?: GridStrategyType[]; +} + +export interface GetHistoricalBalanceParams { + account: string; + resolution: string; +} + +export interface GetHistoricalRpnlParams { + account: string; + resolution: string; +} + +export interface GetHistoricalVolumesParams { + account: string; + resolution: string; +} + +export interface GetPnlLeaderboardParams { + startDate: string; + endDate: string; + limit?: number; + account?: string; +} + +export interface GetVolLeaderboardParams { + startDate: string; + endDate: string; + limit?: number; + account?: string; +} + +export interface GetPnlLeaderboardFixedResolutionParams { + resolution: string; + limit?: number; + account?: string; +} + +export interface GetVolLeaderboardFixedResolutionParams { + resolution: string; + limit?: number; + account?: string; +} + +export interface GetDenomHoldersParams { + denom: string; + token?: string; + limit?: number; +} +export interface MarketParams extends PaginationParams { + baseDenom?: string; + quoteDenom?: string; + marketStatus?: string; + marketStatuses?: string[]; +} + +export interface OrderParams extends PaginationParams { + marketId?: string; + marketIds?: string[]; + subaccountId?: string; + orderSide?: OrderSide; + isConditional?: boolean; +} + +export interface OrderHistoryParams extends PaginationParams { + subaccountId?: string; + marketId?: string; + marketIds?: string[]; + orderTypes?: OrderSide[]; + executionTypes?: TradeExecutionType[]; + direction?: TradeDirection; + isConditional?: boolean; + state?: OrderState; +} + +export interface PositionParams extends PaginationParams { + marketId?: string; + marketIds?: string[]; + subaccountId?: string; + direction?: TradeDirection; + address?: string; +} + +export interface TradeParams extends TimeRangeParams, PaginationParams { + tradeId?: string; + marketId?: string; + marketIds?: string[]; + subaccountId?: string; + accountAddress?: string; + direction?: TradeDirection; + executionSide?: TradeExecutionSide; + executionTypes?: TradeExecutionType[]; +} + +export interface FundingParams extends PaginationParams { + marketId?: string; + marketIds?: string[]; + subaccountId?: string; +} + +export interface SubaccountOrderParams extends PaginationParams { + marketId?: string; + subaccountId?: string; +} + +export interface SubaccountTradeParams extends SubaccountOrderParams { + direction?: TradeDirection; + executionType?: TradeExecutionType; +} + +export interface SubaccountHistoryParams extends SubaccountIdParam { + denom?: string; + transferTypes?: string[]; + pagination?: PaginationOption; +} + +export interface SubaccountOrderSummaryParams extends SubaccountIdParam { + marketId?: string; + orderDirection?: string; +} + +export interface OrderStateParams { + spotOrderHashes?: string[]; + derivativeOrderHashes?: string[]; +} + +export interface GetSpotOrderbookV2Params { + marketId: string; +} + +export interface MsgAdminUpdateBinaryOptionsMarketParams { + sender: string; + marketId: string; + settlementPrice: string; + expirationTimestamp: string; + settlementTimestamp: string; + status: GrpcMarketStatus; +} + +export interface MsgAuthorizeStakeGrantsParams { + grantee: string; + amount: string; +} + +export interface MsgBatchCancelBinaryOptionsOrdersParams { + orders: { + marketId: string; + subaccountId: string; + orderHash?: string; + orderMask?: InjectiveExchangeV1Beta1Exchange.OrderMask; + cid?: string; + }[]; +} + +export interface MsgBatchCancelDerivativeOrdersParams { + orders: { + marketId: string; + subaccountId: string; + orderHash?: string; + orderMask?: InjectiveExchangeV1Beta1Exchange.OrderMask; + cid?: string; + }[]; +} + +export interface MsgBatchCancelSpotOrdersParams { + orders: { + marketId: string; + subaccountId: string; + orderHash?: string; + orderMask?: InjectiveExchangeV1Beta1Exchange.OrderMask; + cid?: string; + }[]; +} + +export interface MsgBatchUpdateOrdersParams { + subaccountId: string; + spotMarketIdsToCancelAll?: string[]; + derivativeMarketIdsToCancelAll?: string[]; + binaryOptionsMarketIdsToCancelAll?: string[]; + spotOrdersToCancel?: { + marketId: string; + subaccountId: string; + orderHash?: string; + cid?: string; + }[]; +} + +export interface MsgCancelBinaryOptionsOrderParams { + marketId: string; + subaccountId: string; + orderHash?: string; + orderMask?: InjectiveExchangeV1Beta1Exchange.OrderMask; + cid?: string; +} + +export interface MsgCancelDerivativeOrderParams { + marketId: string; + subaccountId: string; + orderHash?: string; + orderMask?: InjectiveExchangeV1Beta1Exchange.OrderMask; + cid?: string; +} + +export interface MsgCancelSpotOrderParams { + marketId: string; + subaccountId: string; + orderHash?: string; + cid?: string; +} + +export interface MsgCreateBinaryOptionsLimitOrderParams { + marketId: string; + subaccountId: string; + orderType: InjectiveExchangeV1Beta1Exchange.OrderType; + triggerPrice?: string; + feeRecipient: string; + price: string; + margin: string; + quantity: string; + cid?: string; +} + +export interface MsgCreateBinaryOptionsMarketOrderParams { + marketId: string; + subaccountId: string; + orderType: InjectiveExchangeV1Beta1Exchange.OrderType; + triggerPrice?: string; + feeRecipient: string; + price: string; + margin: string; + quantity: string; + cid?: string; +} + +export interface MsgCreateDerivativeLimitOrderParams { + marketId: string; + subaccountId: string; + orderType: InjectiveExchangeV1Beta1Exchange.OrderType; + triggerPrice?: string; + feeRecipient: string; + price: string; + margin: string; + quantity: string; + cid?: string; +} + +export interface MsgCreateDerivativeMarketOrderParams { + marketId: string; + subaccountId: string; + orderType: InjectiveExchangeV1Beta1Exchange.OrderType; + triggerPrice?: string; + feeRecipient: string; + price: string; + margin: string; + quantity: string; + cid?: string; +} + +export interface MsgCreateSpotLimitOrderParams { + marketId: string; + subaccountId: string; + orderType: InjectiveExchangeV1Beta1Exchange.OrderType; + triggerPrice?: string; + feeRecipient: string; + price: string; + quantity: string; + cid?: string; +} + +export interface MsgCreateSpotMarketOrderParams { + marketId: string; + subaccountId: string; + orderType: InjectiveExchangeV1Beta1Exchange.OrderType; + triggerPrice?: string; + feeRecipient: string; + price: string; + quantity: string; + cid?: string; +} + +export interface MsgDepositParams { + subaccountId: string; + amount: { + amount: string; + denom: string; + }; +} + +export interface MsgExternalTransferParams { + srcSubaccountId: string; + dstSubaccountId: string; + totalAmount: { + amount: string; + denom: string; + }; +} + +export interface MsgIncreasePositionMarginParams { + marketId: string; + srcSubaccountId: string; + dstSubaccountId: string; + amount: string; +} + +export interface MsgInstantBinaryOptionsMarketLaunchParams { + proposer: string; + market: { + ticker: string; + admin: string; + oracleSymbol: string; + oracleProvider: string; + oracleScaleFactor: number; + oracleType: InjectiveOracleV1Beta1Oracle.OracleType; + quoteDenom: string; + makerFeeRate: string; + takerFeeRate: string; + expirationTimestamp: number; + settlementTimestamp: number; + minPriceTickSize: string; + minQuantityTickSize: string; + minNotional: string; + }; +} + +export interface MsgInstantSpotMarketLaunchParams { + proposer: string; + market: { + sender: string; + ticker: string; + baseDenom: string; + quoteDenom: string; + minNotional: string; + minPriceTickSize: string; + minQuantityTickSize: string; + }; +} + +export interface MsgLiquidatePositionParams { + subaccountId: string; + injectiveAddress: string; + marketId: string; + /** optional order to provide for liquidation */ + order?: { + marketId: string; + subaccountId: string; + orderType: InjectiveExchangeV1Beta1Exchange.OrderType; + triggerPrice?: string; + feeRecipient: string; + price: string; + margin: string; + quantity: string; + cid?: string; + }; +} + +export interface MsgReclaimLockedFundsParams { + sender: string; + lockedAccountPubKey: string; + signature: Uint8Array; +} + +export interface MsgRewardsOptOutParams { + sender: string; +} + +export interface MsgSignDataParams { + sender: string; + data: string; +} + +export interface MsgWithdrawParams { + subaccountId: string; + amount: { + amount: string; + denom: string; + }; +} diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/types/explorer.ts b/packages/plugin-injective/injective-sdk-client-ts/src/types/explorer.ts new file mode 100644 index 00000000000..2a11e2dba65 --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/types/explorer.ts @@ -0,0 +1,149 @@ +import { + Transaction, + ExplorerValidator, + ValidatorUptime, + PeggyDepositTx, + PeggyWithdrawalTx, + IBCTransferTx, + ExplorerStats, + ExchangePagination, +} from "@injectivelabs/sdk-ts"; +import { InjectiveExplorerRpc } from "@injectivelabs/indexer-proto-ts"; +import { TimeRangeParams } from "./base"; +/// Explorer Module Params +export interface GetTxByHashParams { + hash: string; +} +export interface GetExplorerValidatorParams { + address: string; +} +export interface GetAccountTxParams { + address: string; + limit?: number; + type?: string; + before?: number; + after?: number; + startTime?: number; + endTime?: number; +} + +export interface GetValidatorUptimeParams { + validatorAddress: string; +} + +export interface GetPeggyDepositTxsParams { + receiver?: string; + sender?: string; + limit?: number; + skip?: number; +} + +export interface GetPeggyWithdrawalTxsParams { + sender?: string; + receiver?: string; + limit?: number; + skip?: number; +} + +export interface GetBlocksParams { + before?: number; + after?: number; + limit?: number; + from?: number; + to?: number; +} + +export interface GetBlockParams { + id: string; +} + +export interface GetTxsParams { + before?: number; + after?: number; + limit?: number; + skip?: number; + type?: string; + startTime?: number; + endTime?: number; + chainModule?: string; +} + +export interface GetIBCTransferTxsParams { + sender?: string; + receiver?: string; + srcChannel?: string; + srcPort?: string; + destChannel?: string; + destPort?: string; + limit?: number; + skip?: number; +} + +// Response interfaces +export interface GetTxByHashResponse { + tx: Transaction; +} + +export interface GetAccountTxResponse { + txs: Transaction[]; + pagination: ExchangePagination; +} + +export interface GetExplorerValidatorResponse { + validator: ExplorerValidator; +} + +export interface GetValidatorUptimeResponse { + uptime: ValidatorUptime[]; +} + +export interface GetPeggyDepositTxsResponse { + txs: PeggyDepositTx[]; +} + +export interface GetPeggyWithdrawalTxsResponse { + txs: PeggyWithdrawalTx[]; +} + +export interface GetBlocksResponse + extends InjectiveExplorerRpc.GetBlocksResponse {} + +export interface GetBlockResponse + extends InjectiveExplorerRpc.GetBlockResponse {} + +export interface GetTxsResponse extends InjectiveExplorerRpc.GetTxsResponse {} + +export interface GetIBCTransferTxsResponse { + txs: IBCTransferTx[]; +} + +export interface GetExplorerStatsResponse { + stats: ExplorerStats; +} + +export interface AccountTxParams extends TimeRangeParams { + address: string; + limit?: number; + type?: string; + before?: number; + after?: number; +} + +export interface BlocksParams extends TimeRangeParams { + before?: number; + after?: number; + limit?: number; +} + +export interface BlockParams { + id: string; +} + +export interface TxsParams extends TimeRangeParams { + before?: number; + after?: number; + limit?: number; + skip?: number; + type?: string; + chainModule?: string; +} diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/types/gov.ts b/packages/plugin-injective/injective-sdk-client-ts/src/types/gov.ts new file mode 100644 index 00000000000..2b2a074be63 --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/types/gov.ts @@ -0,0 +1,196 @@ +import { + PaginationOption, + Pagination, + Msgs, + GovModuleStateParams, + Proposal, + ProposalDeposit, + Vote, + TallyResult, +} from "@injectivelabs/sdk-ts"; +import { PaginationParams } from "./base"; +import { + CosmosGovV1Gov, + InjectiveExchangeV1Beta1Exchange, + InjectiveOracleV1Beta1Oracle, +} from "@injectivelabs/core-proto-ts"; +// Governance Module Params +export interface GetProposalsParams { + status: CosmosGovV1Gov.ProposalStatus; + pagination?: PaginationOption; +} + +export interface GetProposalParams { + proposalId: number; +} + +export interface GetProposalDepositsParams { + proposalId: number; + pagination?: PaginationOption; +} + +export interface GetProposalVotesParams { + proposalId: number; + pagination?: PaginationOption; +} + +export interface GetProposalTallyParams { + proposalId: number; +} + +// Response interfaces +export interface GovernanceModuleParamsResponse { + params: GovModuleStateParams; +} + +export interface GetProposalsResponse { + proposals: Proposal[]; + pagination: Pagination; +} + +export interface GetProposalResponse { + proposal: Proposal; +} + +export interface GetProposalDepositsResponse { + deposits: ProposalDeposit[]; + pagination: Pagination; +} + +export interface GetProposalVotesResponse { + votes: Vote[]; + pagination: Pagination; +} + +export interface GetProposalTallyResponse { + tally: TallyResult; +} + +export interface ProposalParams extends PaginationParams { + status: CosmosGovV1Gov.ProposalStatus; +} + +export interface ProposalQueryParams { + proposalId: number; +} + +export interface MsgSubmitProposalExpiryFuturesMarketLaunchParams { + market: { + title: string; + description: string; + ticker: string; + quoteDenom: string; + oracleBase: string; + oracleQuote: string; + expiry: number; + oracleScaleFactor: number; + oracleType: InjectiveOracleV1Beta1Oracle.OracleType; + initialMarginRatio: string; + maintenanceMarginRatio: string; + makerFeeRate: string; + takerFeeRate: string; + minPriceTickSize: string; + minQuantityTickSize: string; + }; + deposit: { + amount: string; + denom: string; + }; +} + +export interface MsgSubmitProposalSpotMarketLaunchParams { + market: { + title: string; + description: string; + ticker: string; + baseDenom: string; + quoteDenom: string; + minPriceTickSize: string; + minQuantityTickSize: string; + makerFeeRate: string; + takerFeeRate: string; + minNotional: string; + }; + deposit: { + amount: string; + denom: string; + }; +} + +export interface MsgSubmitProposalPerpetualMarketLaunchParams { + market: { + title: string; + description: string; + ticker: string; + quoteDenom: string; + oracleBase: string; + oracleQuote: string; + oracleScaleFactor: number; + oracleType: InjectiveOracleV1Beta1Oracle.OracleType; + initialMarginRatio: string; + maintenanceMarginRatio: string; + makerFeeRate: string; + takerFeeRate: string; + minPriceTickSize: string; + minQuantityTickSize: string; + minNotional: string; + }; + deposit: { + amount: string; + denom: string; + }; +} + +export interface MsgVoteParams { + proposalId: number; + metadata: string; + vote: CosmosGovV1Gov.VoteOption; +} + +export interface MsgSubmitTextProposalParams { + title: string; + description: string; + deposit: { + amount: string; + denom: string; + }; +} + +export interface MsgSubmitProposalSpotMarketParamUpdateParams { + market: { + title: string; + description: string; + marketId: string; + makerFeeRate: string; + takerFeeRate: string; + relayerFeeShareRate: string; + minPriceTickSize: string; + minQuantityTickSize: string; + ticker: string; + status: InjectiveExchangeV1Beta1Exchange.MarketStatus; + }; + deposit: { + amount: string; + denom: string; + }; +} + +export interface MsgSubmitGenericProposalParams { + title: string; + summary: string; + expedited?: boolean; + metadata?: string; + messages: Msgs[]; + deposit: { + amount: string; + denom: string; + }; +} + +export interface MsgGovDepositParams { + proposalId: number; + amount: { + denom: string; + amount: string; + }; +} diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/types/ibc.ts b/packages/plugin-injective/injective-sdk-client-ts/src/types/ibc.ts new file mode 100644 index 00000000000..582c5c35f57 --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/types/ibc.ts @@ -0,0 +1,48 @@ +import { PaginationOption } from "@injectivelabs/sdk-ts"; +import { DenomTrace } from "@injectivelabs/core-proto-ts/cjs/ibc/applications/transfer/v1/transfer.js"; +import { PaginationParams } from "./base"; +//IBC params +export interface GetDenomTraceParams { + hash: string; +} + +export interface GetDenomsTraceParams { + pagination?: PaginationOption; +} + +// Response interfaces +export interface GetDenomTraceResponse { + denomTrace: DenomTrace; +} + +export interface GetDenomsTraceResponse { + denomsTrace: DenomTrace[]; +} + +export interface IBCTransferParams extends PaginationParams { + sender?: string; + receiver?: string; + srcChannel?: string; + srcPort?: string; + destChannel?: string; + destPort?: string; + limit?: number; + skip?: number; +} + +export interface MsgIBCTransferParams { + amount: { + denom: string; + amount: string; + }; + memo?: string; + sender: string; + port: string; + receiver: string; + channelId: string; + timeout?: number; + height?: { + revisionHeight: number; + revisionNumber: number; + }; +} diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/types/index.ts b/packages/plugin-injective/injective-sdk-client-ts/src/types/index.ts new file mode 100644 index 00000000000..ceb1f7d2ae7 --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/types/index.ts @@ -0,0 +1,44 @@ +export * from "./base"; +export * from "./auction"; +export * from "./auth"; +export * from "./bank"; +export * from "./distribution"; +export * from "./exchange"; +export * from "./explorer"; +export * from "./gov"; +export * from "./ibc"; +export * from "./insurance"; +export * from "./mint"; +export * from "./mito"; +export * from "./peggy"; +export * from "./permissions"; +export * from "./staking"; +export * from "./token-factory"; +export * from "./wasm"; + +// Generic Standard Response +export interface StandardResponse { + success: boolean; + result: T; +} + +// Helper functions with generic success type parameter +export function createSuccessResponse(data: T): StandardResponse { + return { + success: true, + result: data, + }; +} +// Helper functions with generic error type parameter +export function createErrorResponse( + code: string, + details?: unknown +): StandardResponse { + return { + success: false, + result: { + code, + details, + }, + }; +} diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/types/insurance.ts b/packages/plugin-injective/injective-sdk-client-ts/src/types/insurance.ts new file mode 100644 index 00000000000..242067a87d4 --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/types/insurance.ts @@ -0,0 +1,78 @@ +import { InsuranceFund, InsuranceModuleParams } from "@injectivelabs/sdk-ts"; +import { InjectiveOracleV1Beta1Oracle } from "@injectivelabs/core-proto-ts"; + +// Insurance Fund Module Params +export interface GetInsuranceFundParams { + marketId: string; +} + +export interface GetEstimatedRedemptionsParams { + marketId: string; + address: string; +} + +export interface GetPendingRedemptionsParams { + marketId: string; + address: string; +} + +// Response interfaces +export interface InsuranceModuleParamsResponse { + params: InsuranceModuleParams; +} + +export interface GetInsuranceFundsResponse { + funds: InsuranceFund[]; +} + +export interface GetInsuranceFundResponse { + fund: InsuranceFund; +} + +export interface RedemptionAmount { + amount: string; + denom: string; +} + +export interface GetEstimatedRedemptionsResponse { + redemption: RedemptionAmount; +} + +export interface GetPendingRedemptionsResponse { + redemptions: RedemptionAmount[]; +} +export interface InsuranceFundParams { + marketId: string; + address: string; +} + +export interface MsgCreateInsuranceFundParams { + fund: { + ticker: string; + quoteDenom: string; + oracleBase: string; + oracleQuote: string; + oracleType: InjectiveOracleV1Beta1Oracle.OracleType; + expiry?: number; + }; + deposit: { + amount: string; + denom: string; + }; +} + +export interface MsgRequestRedemptionParams { + marketId: string; + amount: { + denom: string; + amount: string; + }; +} + +export interface MsgUnderwriteParams { + marketId: string; + amount: { + denom: string; + amount: string; + }; +} diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/types/mint.ts b/packages/plugin-injective/injective-sdk-client-ts/src/types/mint.ts new file mode 100644 index 00000000000..18e0bba08cf --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/types/mint.ts @@ -0,0 +1,14 @@ +import { MinModuleParams } from "@injectivelabs/sdk-ts"; +// Mint module params +// Response interfaces +export interface MintModuleParamsResponse { + params: MinModuleParams; +} + +export interface GetInflationResponse { + inflation: string; +} + +export interface GetAnnualProvisionsResponse { + annualProvisions: string; +} diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/types/mito.ts b/packages/plugin-injective/injective-sdk-client-ts/src/types/mito.ts new file mode 100644 index 00000000000..e9aa45f2072 --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/types/mito.ts @@ -0,0 +1,542 @@ +import { + Coin, + MitoVault, + MitoPagination, + MitoPriceSnapshot, + MitoSubscription, + MitoHolders, + MitoPortfolio, + MitoLeaderboard, + MitoTransfer, + MitoLeaderboardEpoch, + MitoStakingPool, + MitoMission, + MitoMissionLeaderboard, + MitoIDO, + MitoIDOSubscriber, + MitoTokenInfo, + MitoIDOSubscription, + MitoIDOSubscriptionActivity, + MitoWhitelistAccount, + MitoClaimReference, +} from "@injectivelabs/sdk-ts"; +import { PaginationParams, TimeRangeParams, AddressParams } from "./base"; +// Mito Module Params +// Param interfaces + +export interface GetVaultParams { + contractAddress?: string; + slug?: string; +} + +export interface GetVaultsParams { + limit?: number; + codeId?: string; + pageIndex?: number; +} + +export interface GetLpTokenPriceChartParams { + to?: string; + from?: string; + vaultAddress: string; +} + +export interface GetTVLChartParams { + to?: string; + from?: string; + vaultAddress: string; +} + +export interface GetVaultsByHolderAddressParams { + skip?: number; + limit?: number; + holderAddress: string; + vaultAddress?: string; +} + +export interface GetLPHoldersParams { + skip?: number; + limit?: number; + vaultAddress: string; + stakingContractAddress: string; +} + +export interface GetHolderPortfolioParams { + holderAddress: string; + stakingContractAddress: string; +} + +export interface GetTransferHistoryParams { + vault?: string; + account?: string; + limit?: number; + toNumber?: number; + fromNumber?: number; +} + +export interface GetLeaderboardParams { + epochId?: number; +} + +export interface GetLeaderboardEpochsParams { + limit?: number; + toEpochId?: number; + fromEpochId?: number; +} + +export interface GetStakingPoolsParams { + staker?: string; + stakingContractAddress: string; +} + +export interface GetStakingHistoryParams { + staker?: string; + limit?: number; + toNumber?: number; + fromNumber?: number; +} + +export interface GetStakingRewardsByAccountParams { + staker: string; + stakingContractAddress: string; +} + +export interface GetMissionsParams { + accountAddress: string; +} + +export interface GetMissionLeaderboardParams { + userAddress?: string; +} + +export interface GetIDOParams { + contractAddress: string; + accountAddress?: string; +} + +export interface GetIDOsParams { + status?: string; + limit?: number; + toNumber?: number; + accountAddress?: string; + ownerAddress?: string; +} + +export interface GetIDOSubscribersParams { + skip?: number; + limit?: number; + sortBy?: string; + contractAddress: string; +} + +export interface GetIDOSubscriptionParams { + contractAddress: string; + accountAddress: string; +} + +export interface GetIDOActivitiesParams { + contractAddress?: string; + accountAddress?: string; + limit?: number; + toNumber?: string; +} + +export interface GetIDOWhitelistParams { + skip?: number; + limit?: number; + idoAddress: string; +} + +export interface GetClaimReferencesParams { + skip?: number; + limit?: number; + idoAddress: string; + accountAddress: string; +} + +// Response interfaces +export interface GetVaultResponse { + vault: MitoVault; +} + +export interface GetVaultsResponse { + vaults: MitoVault[]; + pagination?: MitoPagination; +} + +export interface GetLpTokenPriceChartResponse { + priceSnapshots: MitoPriceSnapshot[]; +} + +export interface GetTVLChartResponse { + priceSnapshots: MitoPriceSnapshot[]; +} + +export interface GetVaultsByHolderAddressResponse { + subscriptions: MitoSubscription[]; + pagination?: MitoPagination; +} + +export interface GetLPHoldersResponse { + holders: MitoHolders[]; + pagination?: MitoPagination; +} + +export interface GetHolderPortfolioResponse { + portfolio: MitoPortfolio; +} + +export interface GetTransferHistoryResponse { + transfers: MitoTransfer[]; + pagination?: MitoPagination; +} + +export interface GetLeaderboardResponse { + leaderboard: MitoLeaderboard; +} + +export interface GetLeaderboardEpochsResponse { + epochs: MitoLeaderboardEpoch[]; + pagination?: MitoPagination; +} + +export interface GetStakingPoolsResponse { + pools: MitoStakingPool[]; + pagination?: MitoPagination; +} + +export interface StakingActivity { + action: string; + txHash: string; + staker: string; + vaultAddress: string; + numberByAccount: number; + timestamp: number; + rewardedTokens: Coin[]; + stakeAmount: Coin | undefined; +} + +export interface GetStakingHistoryResponse { + activities: StakingActivity[]; + pagination?: MitoPagination; +} + +export interface StakingReward { + apr: number; + vaultName: string; + vaultAddress: string; + lockTimestamp: number; + claimableRewards: Coin[]; + stakedAmount: Coin | undefined; + lockedAmount: Coin | undefined; +} + +export interface GetStakingRewardsByAccountResponse { + rewards: StakingReward[]; + pagination?: MitoPagination; +} + +export interface GetMissionsResponse { + missions: MitoMission[]; +} + +export interface GetMissionLeaderboardResponse { + leaderboard: MitoMissionLeaderboard; +} + +export interface GetIDOResponse { + ido?: MitoIDO; +} + +export interface GetIDOsResponse { + idos: MitoIDO[]; + pagination?: MitoPagination; +} + +export interface GetIDOSubscribersResponse { + marketId: string; + quoteDenom: string; + subscribers: MitoIDOSubscriber[]; + pagination?: MitoPagination; + tokenInfo?: MitoTokenInfo; +} + +export interface GetIDOSubscriptionResponse { + subscription?: MitoIDOSubscription; +} + +export interface GetIDOActivitiesResponse { + activities: MitoIDOSubscriptionActivity[]; + pagination?: MitoPagination; +} + +export interface GetIDOWhitelistResponse { + idoAddress?: string; + accounts: MitoWhitelistAccount[]; + pagination?: MitoPagination; +} + +export interface GetClaimReferencesResponse { + claimReferences: MitoClaimReference[]; + pagination?: MitoPagination; +} + +export interface VaultParams { + contractAddress?: string; + slug?: string; +} + +export interface VaultsParams extends PaginationParams { + limit?: number; + codeId?: string; + pageIndex?: number; +} + +export interface ChartParams extends TimeRangeParams { + vaultAddress: string; +} + +export interface VaultHolderParams extends PaginationParams { + skip?: number; + limit?: number; + holderAddress: string; + vaultAddress?: string; +} + +export interface LPHoldersParams extends PaginationParams { + skip?: number; + limit?: number; + vaultAddress: string; + stakingContractAddress: string; +} + +export interface HolderPortfolioParams { + holderAddress: string; + stakingContractAddress: string; +} + +export interface TransferHistoryParams extends PaginationParams { + vault?: string; + account?: string; + limit?: number; + toNumber?: number; + fromNumber?: number; +} + +export interface LeaderboardEpochParams extends PaginationParams { + limit?: number; + toEpochId?: number; + fromEpochId?: number; +} + +export interface StakingPoolParams { + staker?: string; + stakingContractAddress: string; +} + +export interface StakingHistoryParams extends PaginationParams { + staker?: string; + limit?: number; + toNumber?: number; + fromNumber?: number; +} + +export interface StakingRewardsParams { + staker: string; + stakingContractAddress: string; +} + +export interface MissionParams extends AddressParams { + accountAddress: string; +} + +export interface IDOParams { + contractAddress: string; + accountAddress?: string; +} + +export interface IDOListParams extends PaginationParams { + status?: string; + limit?: number; + toNumber?: number; + accountAddress?: string; + ownerAddress?: string; +} + +export interface IDOSubscribersParams extends PaginationParams { + skip?: number; + limit?: number; + sortBy?: string; + contractAddress: string; +} + +export interface IDOSubscriptionParams { + contractAddress: string; + accountAddress: string; +} + +export interface IDOActivityParams extends PaginationParams { + contractAddress?: string; + accountAddress?: string; + limit?: number; + toNumber?: string; +} + +export interface IDOWhitelistParams extends PaginationParams { + skip?: number; + limit?: number; + idoAddress: string; +} + +export interface ClaimReferenceParams extends PaginationParams { + skip?: number; + limit?: number; + idoAddress: string; + accountAddress: string; +} + +export enum VaultContractType { + ManagedVault = "crates.io:managed-vault", + CPMM = "crates.io:vault-cpmm-spot", + ASMMSpot = "crates.io:vault-asmm-spot", + ASMMPerp = "crates.io:vault-asmm-perp", +} + +export enum DerivativeRedemptionType { + QuoteOnly = "QuoteOnly", + PositionAndQuote = "PositionAndQuote", +} + +export enum SpotRedemptionType { + BaseOnly = "BaseOnly", + QuoteOnly = "QuoteOnly", + BaseAndQuote = "BaseAndQuote", + FixedBaseAndQuote = "FixedBaseAndQuote", + VariableBaseAndQuote = "VariableBaseAndQuote", +} + +export enum VaultMarketType { + Spot = "Spot", + Derivative = "Derivative", +} + +export interface GetLaunchpadSubscribeParams { + amount: number; + quoteTokenDenom: string; + quoteTokenDecimals: number; + contractAddress: string; +} +export interface GetLaunchpadClaimParams { + contractAddress: string; +} + +export interface GetSubscribeVaultParams { + market: { + baseDenom: string; + baseDecimals: number; + quoteDecimals: number; + quoteDenom: string; + }; + + baseAmount: number; + quoteAmount: number; + subscriptionType: SpotRedemptionType; + vaultDetails: { + vaultSubaccountId: string; + vaultMasterAddress: string; + vaultType: VaultContractType; + }; + slippage?: { + max_penalty: string; + }; +} + +export interface GetInstantiateCPMMVaultParams { + MITO_MASTER_CONTRACT_ADDRESS: string; + CPMM_CONTRACT_CODE: number; + senderWalletAddress: string; + marketId: string; + feeBps: number; + baseDecimals: number; + quoteDecimals: number; + funds: { + denom: string; + amount: string; + }[]; + // Overrides default parameters + notionalValueCap?: string; + pricingStrategy?: { + SmoothingPricingWithRelativePriceRange: { + bid_range: string; + ask_range: string; + }; + }; + maxInvariantSensitivityBps?: string; + maxPriceSensitivityBps?: string; + orderType?: string; +} + +export interface GetVaultSubscribeParams { + vaultType: VaultContractType; + slippage?: { + max_penalty: string; + }; + + vaultSubaccountId: string; + baseAmount: number; + quoteAmount: number; + market: { + baseDenom: string; + baseDecimals: number; + quoteDenom: string; + quoteDecimals: number; + }; + subscriptionType: SpotRedemptionType; + masterAddress: string; +} + +export interface GetVaultRedeemParams { + vaultSubaccountId: string; + marketType: VaultMarketType; + slippage?: { + max_penalty: string; + }; + redemptionType: SpotRedemptionType | DerivativeRedemptionType; + redeemAmount: number; + vaultBaseDecimals: number; + masterAddress: string; + vaultLpDenom: string; +} + +export interface GetStakeVaultLPParams { + amount: number; + vaultLpDenom: string; + vaultTokenDecimals: number; + stakingContractAddress: string; +} + +export interface GetUnstakeVaultLPParams { + amount: number; + vaultLpDenom: string; + vaultTokenDecimals: number; + stakingContractAddress: string; +} + +export interface GetClaimVaultRewardsParams { + vaultLpDenom: string; + stakingContractAddress: string; +} + +export interface GetVaultsParams { + skip?: number; + limit?: number; +} + +export interface GetLPHoldersParams { + vaultAddress: string; + stakingContractAddress: string; +} + +export interface GetStakingPoolsParams { + stakingContractAddress: string; +} diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/types/peggy.ts b/packages/plugin-injective/injective-sdk-client-ts/src/types/peggy.ts new file mode 100644 index 00000000000..182ecabfd8b --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/types/peggy.ts @@ -0,0 +1,11 @@ +//Peggy +export interface MsgSendToEthParams { + amount: { + denom: string; + amount: string; + }; + bridgeFee?: { + denom: string; + amount: string; + }; +} diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/types/permissions.ts b/packages/plugin-injective/injective-sdk-client-ts/src/types/permissions.ts new file mode 100644 index 00000000000..4b2e9fa105a --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/types/permissions.ts @@ -0,0 +1,69 @@ +import { + Coin, + PermissionsModuleParams, + Namespace, +} from "@injectivelabs/sdk-ts"; +import { AddressParams } from "./base"; + +// Base parameter interfaces +// Permissions Module Params +// Param interfaces +export interface GetAddressesByRoleParams { + denom: string; + role: string; +} + +export interface GetAddressRolesParams { + address: string; + denom: string; +} + +export interface GetNamespaceByDenomParams { + denom: string; + includeRoles: boolean; +} + +export interface GetVouchersForAddressParams { + address: string; +} + +// Response interfaces +export interface GetAddressesByRoleResponse { + addresses: string[]; +} + +export interface GetAddressRolesResponse { + roles: string[]; +} + +export interface GetAllNamespacesResponse { + namespaces: Namespace[]; +} + +export interface GetPermissionsModuleParamsResponse { + params: PermissionsModuleParams; +} + +export interface GetNamespaceByDenomResponse { + namespace: Namespace; +} + +export interface GetVouchersForAddressResponse { + vouchers: Coin[]; +} +export interface RoleParams { + denom: string; + role: string; +} + +export interface AddressRoleParams { + address: string; + denom: string; +} + +export interface NamespaceParams { + denom: string; + includeRoles: boolean; +} + +export interface VoucherParams extends AddressParams {} diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/types/staking.ts b/packages/plugin-injective/injective-sdk-client-ts/src/types/staking.ts new file mode 100644 index 00000000000..366a48144ee --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/types/staking.ts @@ -0,0 +1,175 @@ +import { + PaginationOption, + Pagination, + StakingModuleParams, + Pool, + Validator, + Delegation, + UnBondingDelegation, + ReDelegation, +} from "@injectivelabs/sdk-ts"; +import { PaginationParams } from "./base"; +// Staking Module Params +// Param interfaces + +export interface GetValidatorsParams { + pagination?: PaginationOption; +} + +export interface GetValidatorParams { + address: string; +} + +export interface GetValidatorDelegationsParams { + validatorAddress: string; + pagination?: PaginationOption; +} + +export interface GetDelegationParams { + injectiveAddress: string; + validatorAddress: string; +} + +export interface GetDelegationsParams { + injectiveAddress: string; + pagination?: PaginationOption; +} + +export interface GetDelegatorsParams { + validatorAddress: string; + pagination?: PaginationOption; +} + +export interface GetUnbondingDelegationsParams { + injectiveAddress: string; + pagination?: PaginationOption; +} + +export interface GetReDelegationsParams { + injectiveAddress: string; + pagination?: PaginationOption; +} + +// Response interfaces +export interface GetStakingModuleParamsResponse { + params: StakingModuleParams; +} + +export interface GetPoolResponse { + pool: Pool; +} + +export interface GetValidatorsResponse { + validators: Validator[]; + pagination: Pagination; +} + +export interface GetValidatorResponse { + validator: Validator; +} + +export interface GetValidatorDelegationsResponse { + delegations: Delegation[]; + pagination: Pagination; +} + +export interface GetDelegationResponse { + delegation: Delegation; +} + +export interface GetDelegationsResponse { + delegations: Delegation[]; + pagination: Pagination; +} + +export interface GetUnbondingDelegationsResponse { + unbondingDelegations: UnBondingDelegation[]; + pagination: Pagination; +} + +export interface GetReDelegationsResponse { + redelegations: ReDelegation[]; + pagination: Pagination; +} +export interface MsgBeginRedelegateParams { + amount: { + denom: string; + amount: string; + }; + srcValidatorAddress: string; + dstValidatorAddress: string; +} + +export interface MsgDelegateParams { + amount: { + denom: string; + amount: string; + }; + validatorAddress: string; +} + +export interface MsgUndelegateParams { + amount: { + denom: string; + amount: string; + }; + validatorAddress: string; +} + +export interface MsgCreateValidatorParams { + description: { + moniker: string; + identity: string; + website: string; + securityContact?: string; + details: string; + }; + value: { + amount: string; + denom: string; + }; + pubKey: { + type: string; + value: string; + }; + delegatorAddress: string; + validatorAddress: string; + commission: { + maxChangeRate: string; + rate: string; + maxRate: string; + }; +} + +export interface MsgEditValidatorParams { + description: { + moniker: string; + identity: string; + website: string; + securityContact?: string; + details: string; + }; + validatorAddress: string; + commissionRate?: string; + minSelfDelegation?: string; +} + +export interface MsgCancelUnbondingDelegationParams { + amount: { + denom: string; + amount: string; + }; + validatorAddress: string; + delegatorAddress: string; + creationHeight: string; +} + +export interface ValidatorParams extends PaginationParams { + validatorAddress: string; +} + +export interface DelegationParams { + validatorAddress: string; +} + +export interface DelegationsParams extends PaginationParams {} diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/types/token-factory.ts b/packages/plugin-injective/injective-sdk-client-ts/src/types/token-factory.ts new file mode 100644 index 00000000000..7c4e56e2c7c --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/types/token-factory.ts @@ -0,0 +1,63 @@ +import { + AuthorityMetadata, + TokenFactoryModuleParams, + TokenFactoryModuleState, +} from "@injectivelabs/sdk-ts"; +import { CosmosBankV1Beta1Bank } from "@injectivelabs/core-proto-ts"; +// Token Factory Module Params// Param interfaces +export interface GetDenomsFromCreatorParams { + creator: string; +} + +export interface GetDenomAuthorityMetadataParams { + creator: string; + subDenom: string; +} + +// Response interfaces +export interface GetDenomsFromCreatorResponse { + denoms: string[]; +} + +export interface GetDenomAuthorityMetadataResponse { + metadata: AuthorityMetadata; +} + +export interface GetTokenFactoryModuleParamsResponse { + params: TokenFactoryModuleParams; +} + +export interface GetTokenFactoryModuleStateResponse { + state: TokenFactoryModuleState; +} +export interface TokenFactoryParams { + creator: string; + subDenom: string; +} + +export interface MsgBurnParams { + amount: { + amount: string; + denom: string; + }; +} +export interface MsgChangeAdminParams { + denom: string; + newAdmin: string; +} + +export interface MsgCreateDenomParams { + subdenom: string; + decimals?: number; + name?: string; + symbol?: string; +} +export interface MsgMintParams { + totalAmount: { + amount: string; + denom: string; + }; +} +export interface MsgSetDenomMetadataParams { + metadata: CosmosBankV1Beta1Bank.Metadata; +} diff --git a/packages/plugin-injective/injective-sdk-client-ts/src/types/wasm.ts b/packages/plugin-injective/injective-sdk-client-ts/src/types/wasm.ts new file mode 100644 index 00000000000..68fd78d4bc9 --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/src/types/wasm.ts @@ -0,0 +1,184 @@ +import { + PaginationOption, + Pagination, + ExecArgs, + ExecPrivilegedArgs, + ContractAccountsBalanceWithPagination, + ContractStateWithPagination, + ContractInfo, + ContractCodeHistoryEntry, + CodeInfoResponse, +} from "@injectivelabs/sdk-ts"; +import { CosmwasmWasmV1Query } from "@injectivelabs/core-proto-ts"; +import { AccessConfig } from "@injectivelabs/core-proto-ts/cjs/cosmwasm/wasm/v1/types"; +import { PaginationParams } from "./base"; +// Wasm Module Params +// Param interfaces +export interface GetContractAccountsBalanceParams { + contractAddress: string; + pagination?: PaginationOption; +} + +export interface GetContractStateParams { + contractAddress: string; + pagination?: PaginationOption; +} + +export interface GetContractInfoParams { + contractAddress: string; +} + +export interface GetContractHistoryParams { + contractAddress: string; +} + +export interface GetSmartContractStateParams { + contractAddress: string; + query?: string | Record; +} + +export interface GetRawContractStateParams { + contractAddress: string; + query?: string; +} + +export interface GetContractCodesParams { + pagination?: PaginationOption; +} + +export interface GetContractCodeParams { + codeId: number; +} + +export interface GetContractCodeContractsParams { + codeId: number; + pagination?: PaginationOption; +} + +// Response interfaces +export interface GetContractAccountsBalanceResponse { + balance: ContractAccountsBalanceWithPagination; +} + +export interface GetContractStateResponse { + state: ContractStateWithPagination; +} + +export interface GetContractInfoResponse { + contractInfo?: ContractInfo; +} + +export interface GetContractHistoryResponse { + entriesList: ContractCodeHistoryEntry[]; + pagination: Pagination; +} + +export interface GetSmartContractStateResponse + extends CosmwasmWasmV1Query.QuerySmartContractStateResponse {} + +export interface GetRawContractStateResponse + extends CosmwasmWasmV1Query.QueryRawContractStateResponse {} + +export interface GetContractCodesResponse { + codeInfosList: CodeInfoResponse[]; + pagination: Pagination; +} + +export interface GetContractCodeResponse { + codeInfo: CodeInfoResponse; + data: Uint8Array; +} + +export interface GetContractCodeContractsResponse { + contractsList: string[]; + pagination: Pagination; +} + +export interface ContractBalanceParams extends PaginationParams { + contractAddress: string; +} + +export interface ContractStateParams extends PaginationParams { + contractAddress: string; +} + +export interface SmartContractParams { + contractAddress: string; + query?: string | Record; +} + +export interface RawContractParams { + contractAddress: string; + query?: string; +} + +export interface ContractCodeParams { + codeId: number; + pagination?: PaginationOption; +} + +export interface MsgStoreCodeParams { + wasmBytes: Uint8Array | string; + instantiatePermission?: AccessConfig; +} +export interface MsgUpdateAdminParams { + newAdmin: string; + contract: string; +} +export interface MsgExecuteContractParams { + funds?: + | { + denom: string; + amount: string; + } + | { + denom: string; + amount: string; + }[]; + sender: string; + contractAddress: string; + execArgs?: ExecArgs; + exec?: { + msg: object; + action: string; + }; + msg?: object; +} +export interface MsgMigrateContractParams { + contract: string; + codeId: number; + msg: object; +} +export interface MsgInstantiateContractParams { + admin: string; + codeId: number; + label: string; + msg: Object; + amount?: { + denom: string; + amount: string; + }; +} +export interface MsgExecuteContractCompatParams { + funds?: + | { + denom: string; + amount: string; + } + | { + denom: string; + amount: string; + }[]; + contractAddress: string; + execArgs?: ExecArgs; + exec?: { + msg: Record; + action: string; + }; + msg?: Record; +} +export interface MsgPrivilegedExecuteContractParams { + funds: string; + contractAddress: string; + data: ExecPrivilegedArgs; +} diff --git a/packages/plugin-injective/injective-sdk-client-ts/tsconfig.json b/packages/plugin-injective/injective-sdk-client-ts/tsconfig.json new file mode 100644 index 00000000000..0605046f5d7 --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "target": "ES2020", + "module": "NodeNext", + "lib": [ + "ES2020" + ], + "moduleResolution": "NodeNext", + "strict": true, + "skipLibCheck": true, + "declaration": true, + "outDir": "./dist", + "esModuleInterop": true, + "resolveJsonModule": true, + "isolatedModules": true, + "forceConsistentCasingInFileNames": true + }, + "include": [ + "./**/*.ts", + "./**/*.d.ts" + ], + "exclude": [ + "node_modules", + "dist" + ] +} \ No newline at end of file diff --git a/packages/plugin-injective/injective-sdk-client-ts/tsup.config.ts b/packages/plugin-injective/injective-sdk-client-ts/tsup.config.ts new file mode 100644 index 00000000000..793480487bb --- /dev/null +++ b/packages/plugin-injective/injective-sdk-client-ts/tsup.config.ts @@ -0,0 +1,48 @@ +import { defineConfig } from 'tsup'; +import { builtinModules } from 'module'; +import pkg from './package.json'; + +export default defineConfig({ + entry: ['src/index.ts'], + format: ['cjs', 'esm'], + dts: true, + sourcemap: true, + clean: true, + splitting: false, + minify: false, + platform: 'node', + target: 'node23', + + noExternal: [ + '@injectivelabs/networks', + '@injectivelabs/sdk-ts', + '@injectivelabs/token-metadata', + '@injectivelabs/ts-types', + '@injectivelabs/utils', + 'form-data', + 'combined-stream' + ], + + external: [ + ...builtinModules.filter(mod => mod !== 'util'), + ...Object.keys(pkg.dependencies || {}) + .filter(dep => !dep.startsWith('@injectivelabs/')) + ], + + esbuildOptions: (options) => { + options.mainFields = ['module', 'main']; + options.banner = { + js: ` + import { createRequire } from 'module'; + import { fileURLToPath } from 'url'; + import { dirname } from 'path'; + const require = createRequire(import.meta.url); + const __filename = fileURLToPath(import.meta.url); + const __dirname = dirname(__filename); + ` + }; + options.define = { + 'process.env.NODE_ENV': '"production"' + }; + } +}); \ No newline at end of file diff --git a/packages/plugin-injective/jest.config.js b/packages/plugin-injective/jest.config.js new file mode 100644 index 00000000000..a6b47f84035 --- /dev/null +++ b/packages/plugin-injective/jest.config.js @@ -0,0 +1,9 @@ +module.exports = { + preset: 'ts-jest', + testEnvironment: 'node', + moduleNameMapper: { + '^@injective/(.*)$': '/injective-sdk-client-ts/src/$1' + }, + testMatch: ['**/tests/**/*.test.ts'], + setupFilesAfterEnv: ['./tests/setup.ts'] +}; diff --git a/packages/plugin-injective/package.json b/packages/plugin-injective/package.json new file mode 100644 index 00000000000..13ba85ddf8f --- /dev/null +++ b/packages/plugin-injective/package.json @@ -0,0 +1,51 @@ +{ + "name": "@elizaos/plugin-injective", + "version": "0.1.7", + "description": "", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "type": "module", + "scripts": { + "build": "tsup --format esm --dts", + "dev": "tsup --format esm --dts --watch", + "lint": "eslint --fix --cache .", + "test": "jest", + "test:watch": "jest --watch", + "format": "prettier --write \"src/**/*.ts\"", + "test:coverage": "jest --coverage" + }, + "exports": { + "./package.json": "./package.json", + ".": { + "require": "./dist/index.cjs", + "import": "./dist/index.js", + "types": "./dist/index.d.ts" + } + }, + "files": [ + "dist" + ], + "keywords": [], + "author": "hrishikesh@injectivelabs.org", + "license": "ISC", + "devDependencies": { + "@types/chai": "^5.0.1", + "@types/jest": "^29.5.14", + "@types/node": "^22.10.3", + "@types/sinon": "^17.0.3", + "@typescript-eslint/eslint-plugin": "8.16.0", + "@typescript-eslint/parser": "8.16.0", + "chai": "^5.1.2", + "eslint": "9.16.0", + "jest": "^29.7.0", + "prettier": "3.4.1", + "sinon": "^19.0.2", + "ts-jest": "^29.2.5", + "typescript": "^5.7.2" + }, + "dependencies": { + "@elizaos/adapter-sqlite": "0.1.7-alpha.2", + "@elizaos/core": "workspace:*", + "injective-sdk-client-ts": "file:../../packages/plugin-injective/injective-sdk-client-ts" + } + } \ No newline at end of file diff --git a/packages/plugin-injective/src/action/auction.ts b/packages/plugin-injective/src/action/auction.ts new file mode 100644 index 00000000000..7d1c1e6f31c --- /dev/null +++ b/packages/plugin-injective/src/action/auction.ts @@ -0,0 +1,72 @@ +import { createGenericAction } from "./base"; +import * as AuctionTemplates from "@injective/template/auction"; +import * as AuctionExamples from "@injective/examples/auction"; +import * as AuctionSimilies from "@injective/similes/auction"; +export const GetAuctionModuleParamsAction = createGenericAction({ + name: "GET_AUCTION_MODULE_PARAMS", + description: "Fetches the auction module parameters", + template: AuctionTemplates.getAuctionModuleParamsTemplate, + examples: AuctionExamples.getAuctionModuleParamsExample, + similes: AuctionSimilies.getAuctionModuleParamsSimiles, + functionName: "getAuctionModuleParams", + validateContent: () => true, +}); + +export const GetAuctionModuleStateAction = createGenericAction({ + name: "GET_AUCTION_MODULE_STATE", + description: "Fetches the auction module state", + template: AuctionTemplates.getAuctionModuleStateTemplate, + examples: AuctionExamples.getAuctionModuleStateExample, + similes: AuctionSimilies.getAuctionModuleStateSimiles, + functionName: "getAuctionModuleState", + validateContent: () => true, +}); + +export const GetCurrentBasketAction = createGenericAction({ + name: "GET_CURRENT_BASKET", + description: "Fetches the current auction basket", + template: AuctionTemplates.getCurrentBasketTemplate, + examples: AuctionExamples.getCurrentBasketExample, + functionName: "getCurrentBasket", + similes: AuctionSimilies.getCurrentBasketSimiles, + validateContent: () => true, +}); + +export const GetAuctionRoundAction = createGenericAction({ + name: "GET_AUCTION_ROUND", + description: "Fetches details of a specific auction round", + template: AuctionTemplates.getAuctionRoundTemplate, + examples: AuctionExamples.getAuctionRoundExample, + similes: AuctionSimilies.getAuctionRoundSimiles, + functionName: "getAuctionRound", + validateContent: () => true, +}); + +export const GetAuctionsAction = createGenericAction({ + name: "GET_AUCTIONS", + description: "Fetches a list of auctions", + template: AuctionTemplates.getAuctionsTemplate, + examples: AuctionExamples.getAuctionsExample, + similes: AuctionSimilies.getAuctionsSimiles, + functionName: "getAuctions", + validateContent: () => true, +}); + +export const MsgBidAction = createGenericAction({ + name: "MSG_BID", + description: "Places a bid in an auction round", + template: AuctionTemplates.msgBidTemplate, + examples: AuctionExamples.msgBidExample, + similes: AuctionSimilies.MsgBidSimiles, + functionName: "msgBid", + validateContent: () => true, +}); + +export const AuctionActions = [ + GetAuctionModuleParamsAction, + GetAuctionModuleStateAction, + GetCurrentBasketAction, + GetAuctionRoundAction, + GetAuctionsAction, + MsgBidAction, +]; diff --git a/packages/plugin-injective/src/action/auth.ts b/packages/plugin-injective/src/action/auth.ts new file mode 100644 index 00000000000..ff82e083f31 --- /dev/null +++ b/packages/plugin-injective/src/action/auth.ts @@ -0,0 +1,107 @@ +import { createGenericAction } from "./base"; +import * as AuthTemplates from "@injective/template/auth"; +import * as AuthExamples from "@injective/examples/auth"; +import * as AuthSimilies from "@injective/similes/auth"; +// Auth Module Actions +export const GetAuthModuleParamsAction = createGenericAction({ + name: "GET_AUTH_MODULE_PARAMS", + description: "Fetches the authentication module parameters", + template: AuthTemplates.getAuthModuleParamsTemplate, + examples: AuthExamples.getAuthModuleParamsExample, + similes: AuthSimilies.getAuthModuleParamsSimiles, + functionName: "getAuthModuleParams", + validateContent: () => true, +}); + +export const GetAccountDetailsAction = createGenericAction({ + name: "GET_ACCOUNT_DETAILS", + description: "Fetches the details of the current account", + template: AuthTemplates.getAccountDetailsTemplate, + examples: AuthExamples.getAccountDetailsExample, + similes: AuthSimilies.getAccountDetailsSimiles, + functionName: "getAccountDetails", + validateContent: () => true, +}); + +export const GetAccountsAction = createGenericAction({ + name: "GET_ACCOUNTS", + description: "Fetches all accounts associated with the current address", + template: AuthTemplates.getAccountsTemplate, + examples: AuthExamples.getAccountsExample, + similes: AuthSimilies.getAccountsSimiles, + functionName: "getAccounts", + validateContent: () => true, +}); + +export const GetGrantsAction = createGenericAction({ + name: "GET_GRANTS", + description: "Fetches all grants based on provided parameters", + template: AuthTemplates.getGrantsTemplate, + examples: AuthExamples.getGrantsExample, + similes: AuthSimilies.getGrantsSimiles, + functionName: "getGrants", + validateContent: () => true, +}); + +export const GetGranterGrantsAction = createGenericAction({ + name: "GET_GRANTER_GRANTS", + description: "Fetches all grants granted by a specific granter", + template: AuthTemplates.getGranterGrantsTemplate, + examples: AuthExamples.getGranterGrantsExample, + similes: AuthSimilies.getGranterGrantsSimiles, + functionName: "getGranterGrants", + validateContent: () => true, +}); + +export const GetGranteeGrantsAction = createGenericAction({ + name: "GET_GRANTEE_GRANTS", + description: "Fetches all grants received by a specific grantee", + template: AuthTemplates.getGranteeGrantsTemplate, + examples: AuthExamples.getGranteeGrantsExample, + similes: AuthSimilies.getGranteeGrantsSimiles, + functionName: "getGranteeGrants", + validateContent: () => true, +}); + +export const MsgGrantAction = createGenericAction({ + name: "MSG_GRANT", + description: + "Grants authorization to a grantee to perform specific actions", + template: AuthTemplates.msgGrantTemplate, + examples: AuthExamples.msgGrantExample, + similes: AuthSimilies.msgGrantSimiles, + functionName: "msgGrant", + validateContent: () => true, +}); + +export const MsgExecAction = createGenericAction({ + name: "MSG_EXEC", + description: "Executes authorized messages on behalf of the grantee", + template: AuthTemplates.msgExecTemplate, + examples: AuthExamples.msgExecExample, + similes: AuthSimilies.msgExecSimiles, + functionName: "msgExec", + validateContent: () => true, +}); + +export const MsgRevokeAction = createGenericAction({ + name: "MSG_REVOKE", + description: "Revokes previously granted authorizations from a grantee", + template: AuthTemplates.msgRevokeTemplate, + examples: AuthExamples.msgRevokeExample, + similes: AuthSimilies.msgRevokeSimiles, + functionName: "msgRevoke", + validateContent: () => true, +}); + +export const AuthActions = [ + GetAuthModuleParamsAction, + GetAccountDetailsAction, + GetAccountsAction, + GetGrantsAction, + GetGranterGrantsAction, + GetGranteeGrantsAction, + MsgGrantAction, + MsgExecAction, + MsgRevokeAction, +]; diff --git a/packages/plugin-injective/src/action/bank.ts b/packages/plugin-injective/src/action/bank.ts new file mode 100644 index 00000000000..ace1a608c34 --- /dev/null +++ b/packages/plugin-injective/src/action/bank.ts @@ -0,0 +1,129 @@ +import { createGenericAction } from "./base"; +import * as BankTemplates from "@injective/template/bank"; +import * as BankExamples from "@injective/examples/bank"; +import * as BankSimilies from "@injective/similes/bank"; +// Query Actions +export const GetBankModuleParamsAction = createGenericAction({ + name: "GET_BANK_MODULE_PARAMS", + description: "Fetches the bank module parameters", + template: BankTemplates.getBankModuleParamsTemplate, + examples: BankExamples.getBankModuleParamsExample, + similes: BankSimilies.getBankModuleParamsSimiles, + functionName: "getBankModuleParams", + validateContent: () => true, +}); + +export const GetBankBalanceAction = createGenericAction({ + name: "GET_BANK_BALANCE", + description: "Fetches the balance of a specific account", + template: BankTemplates.getBankBalanceTemplate, + examples: BankExamples.getBankBalanceExample, + similes: BankSimilies.getBankBalanceSimiles, + functionName: "getBankBalance", + validateContent: () => true, +}); + +export const GetBankBalancesAction = createGenericAction({ + name: "GET_BANK_BALANCES", + description: "Fetches all balances for the current account", + template: BankTemplates.getBankBalancesTemplate, + examples: BankExamples.getBankBalancesExample, + similes: BankSimilies.getBankBalancesSimiles, + functionName: "getBankBalances", + validateContent: () => true, +}); + +export const GetTotalSupplyAction = createGenericAction({ + name: "GET_TOTAL_SUPPLY", + description: "Fetches the total supply of all denominations", + template: BankTemplates.getTotalSupplyTemplate, + examples: BankExamples.getTotalSupplyExample, + similes: BankSimilies.getTotalSupplySimiles, + functionName: "getTotalSupply", + validateContent: () => true, +}); + +export const GetAllTotalSupplyAction = createGenericAction({ + name: "GET_ALL_TOTAL_SUPPLY", + description: "Fetches the total supply for all denominations", + template: BankTemplates.getAllTotalSupplyTemplate, + examples: BankExamples.getAllTotalSupplyExample, + similes: BankSimilies.getAllTotalSupplySimiles, + functionName: "getAllTotalSupply", + validateContent: () => true, +}); + +export const GetSupplyOfAction = createGenericAction({ + name: "GET_SUPPLY_OF", + description: "Fetches the supply of a specific denomination", + template: BankTemplates.getSupplyOfTemplate, + examples: BankExamples.getSupplyOfExample, + similes: BankSimilies.getSupplyOfSimiles, + functionName: "getSupplyOf", + validateContent: () => true, +}); + +export const GetDenomsMetadataAction = createGenericAction({ + name: "GET_DENOMS_METADATA", + description: "Fetches metadata for all denominations", + template: BankTemplates.getDenomsMetadataTemplate, + examples: BankExamples.getDenomsMetadataExample, + similes: BankSimilies.getDenomMetadataSimiles, + functionName: "getDenomsMetadata", + validateContent: () => true, +}); + +export const GetDenomMetadataAction = createGenericAction({ + name: "GET_DENOM_METADATA", + description: "Fetches metadata for a specific denomination", + template: BankTemplates.getDenomMetadataTemplate, + examples: BankExamples.getDenomMetadataExample, + similes: BankSimilies.getDenomMetadataSimiles, + functionName: "getDenomMetadata", + validateContent: () => true, +}); + +export const GetDenomOwnersAction = createGenericAction({ + name: "GET_DENOM_OWNERS", + description: "Fetches the owners of a specific denomination", + template: BankTemplates.getDenomOwnersTemplate, + examples: BankExamples.getDenomOwnersExample, + similes: BankSimilies.getDenomOwnersSimiles, + functionName: "getDenomOwners", + validateContent: () => true, +}); + +// Transaction Actions +export const MsgSendAction = createGenericAction({ + name: "MSG_SEND", + description: "Sends tokens from one account to another", + template: BankTemplates.msgSendTemplate, + examples: BankExamples.msgSendExample, + similes: BankSimilies.msgSendSimiles, + functionName: "msgSend", + validateContent: () => true, +}); + +export const MsgMultiSendAction = createGenericAction({ + name: "MSG_MULTI_SEND", + description: "Sends tokens from multiple senders to multiple receivers", + template: BankTemplates.msgMultiSendTemplate, + examples: BankExamples.msgMultiSendExample, + similes: BankSimilies.msgMultiSendSimiles, + functionName: "msgMultiSend", + validateContent: () => true, +}); + +export const BankActions = [ + GetBankModuleParamsAction, + GetBankBalanceAction, + GetBankBalancesAction, + GetTotalSupplyAction, + GetAllTotalSupplyAction, + GetSupplyOfAction, + GetDenomsMetadataAction, + GetDenomMetadataAction, + GetDenomOwnersAction, + MsgSendAction, + MsgMultiSendAction, +]; diff --git a/packages/plugin-injective/src/action/base.ts b/packages/plugin-injective/src/action/base.ts new file mode 100644 index 00000000000..73933aeaafb --- /dev/null +++ b/packages/plugin-injective/src/action/base.ts @@ -0,0 +1,183 @@ +// createGenericAction.ts +import { ActionExample } from "@elizaos/core"; +import { + HandlerCallback, + IAgentRuntime, + Memory, + ModelClass, + State, + elizaLogger, + composeContext, + type Action, + generateObjectDeprecated, + generateText, +} from "@elizaos/core"; +import { InjectiveGrpcClient } from "@injective/modules"; + +/** + * Shape of the arguments to create our generic action. + * + * @property {string} name - The action name (e.g., "PLACE_BID", "CANCEL_BID"). + * @property {string} description - A brief summary of what the action does. + * @property {unknown} template - A template object (e.g., from @injective/template/auction) used for context composition. + * @property {any[]} examples - The example user/assistant interactions you want associated with this action. + * @property {string} functionName - The name of the method you want to call on `InjectiveGrpcClient` (e.g. `"msgBid"`). + * @property {(runtime: IAgentRuntime, content: any) => boolean} validateContent - Function to validate the AI-generated content. + */ +export interface CreateGenericActionArgs { + name: string; + similes: string[]; // (optional) synonyms or alternate names if you like + description: string; + template: string; + examples: any[]; + functionName: string; // e.g. "msgBid" + validateContent: (runtime: IAgentRuntime, content: any) => boolean; +} +/** + * A factory function that returns an ElizaOS Action. + */ +export function createGenericAction({ + name, + description, + template, + examples, + functionName, + similes, +}: CreateGenericActionArgs): Action { + return { + name, // e.g. "PLACE_BID" + description, // e.g. "Place a bid using the InjectiveGrpcClient" + examples: [examples as ActionExample[]], // I have manually casted the inputs here + similes, // (optional) synonyms or alternate names if you like + validate: async (_runtime, _message) => { + return true; + }, + + handler: async ( + runtime: IAgentRuntime, + message: Memory, + state: State, + _options: { [key: string]: unknown }, + callback?: HandlerCallback + ): Promise => { + elizaLogger.debug(`create action: ${name}`); + // 1. Compose or update the state + if (!state) { + state = (await runtime.composeState(message)) as State; + } else { + state = await runtime.updateRecentMessageState(state); + } + + // 2. Compose a context from the given template + const context = composeContext({ + state, + template, + }); + + // 3. Use the AI model to generate content based on the context + const params = await generateObjectDeprecated({ + runtime, + context, + modelClass: ModelClass.LARGE, + }); + + // 5. Initialize the Injective client + try { + const rawNetwork = runtime.getSetting("INJECTIVE_NETWORK"); + const injectivePrivateKey = runtime.getSetting( + "INJECTIVE_PRIVATE_KEY" + ); + const ethPublicKey = runtime.getSetting("EVM_PUBLIC_KEY"); + const injPublicKey = runtime.getSetting("INJECTIVE_PUBLIC_KEY"); + const network = rawNetwork as + | "MainnetK8s" + | "MainnetLB" + | "Mainnet" + | "MainnetSentry" + | "MainnetOld" + | "Staging" + | "Internal" + | "TestnetK8s" + | "TestnetOld" + | "TestnetSentry" + | "Testnet" + | "Devnet1" + | "Devnet2" + | "Devnet" + | "Local"; + if ( + !injectivePrivateKey || + (!ethPublicKey && !injPublicKey) || + !network + ) { + throw new Error("Incorrect configuration"); + } + + const client = new InjectiveGrpcClient( + network, + injectivePrivateKey, + ethPublicKey, + injPublicKey + ); + + // 6. Dynamically call the specified functionName on the Injective client + const method = (client as any)[functionName]; + if (typeof method !== "function") { + throw new Error( + `Method "${functionName}" does not exist on InjectiveGrpcClient` + ); + } + //Function that the LLM extracted + console.log(`wil pass these params ${JSON.stringify(params)}}`); + + //Need to standardize this context params + const response = await method(params); + console.log( + `Recieved a response from InjectiveGrpcClient , response: ${JSON.stringify(response)}, ` + ); + // Lets convert the result of the response into something that can be read + if (response.success) { + console.log("Cleaning up the response"); + const additionalTemplate = `Extract the response from the following data, also make sure that you format the response into human readable format, make it the prettiest thing anyone can read basically a very nice comprehensive summary in a string format.`; + const responseResult = JSON.stringify(response.result); + const newContext = `${additionalTemplate}\n${responseResult}`; + const totalContext = `Previous chat context:${context} \n New information : ${newContext}`; + console.log( + `Got context, now will pass it on to llm ${totalContext}` + ); + const responseContent = await generateText({ + runtime, + context: totalContext, + modelClass: ModelClass.SMALL, + }); + + console.log("Response content:", responseContent); + if (callback) + callback({ + text: `Operation ${name} succeeded, ${responseContent}.`, + content: response.result, + }); + } else { + // 7. Trigger any callback with failure info + if (callback) { + callback({ + text: `Operation ${name} failed.\n${response.result}`, + content: response.result, + }); + } + } + + // Return true if code == 0 (success), else false + return response.result.code === 0; + } catch (error) { + if (callback) { + callback({ + text: `Error in ${name}: ${(error as Error).message}`, + content: { error: (error as Error).message }, + }); + } + return false; + } + }, + }; +} diff --git a/packages/plugin-injective/src/action/distribution.ts b/packages/plugin-injective/src/action/distribution.ts new file mode 100644 index 00000000000..590292f0478 --- /dev/null +++ b/packages/plugin-injective/src/action/distribution.ts @@ -0,0 +1,91 @@ +import { createGenericAction } from "./base"; +import * as DistributionTemplates from "@injective/template/distribution"; +import * as DistributionExamples from "@injective/examples/distribution"; +import * as DistributionSimilies from "@injective/similes/distribution"; + +export const GetDistributionModuleParamsAction = createGenericAction({ + name: "GET_DISTRIBUTION_MODULE_PARAMS", + description: "Fetches the distribution module parameters", + template: DistributionTemplates.getDistributionModuleParamsTemplate, + examples: DistributionExamples.getDistributionModuleParamsExample, + similes: DistributionSimilies.getDistributionModuleParamsSimiles, + functionName: "getDistributionModuleParams", + validateContent: () => true, +}); + +export const GetDelegatorRewardsForValidatorAction = createGenericAction({ + name: "GET_DELEGATOR_REWARDS_FOR_VALIDATOR", + description: "Fetches the delegator rewards for a specific validator", + template: DistributionTemplates.getDelegatorRewardsForValidatorTemplate, + examples: DistributionExamples.getDelegatorRewardsForValidatorExample, + similes: DistributionSimilies.getDelegatorRewardsForValidatorSimiles, + functionName: "getDelegatorRewardsForValidator", + validateContent: () => true, +}); + +export const GetDelegatorRewardsForValidatorNoThrowAction = createGenericAction( + { + name: "GET_DELEGATOR_REWARDS_FOR_VALIDATOR_NO_THROW", + description: + "Fetches the delegator rewards for a specific validator without throwing errors", + template: + DistributionTemplates.getDelegatorRewardsForValidatorNoThrowTemplate, + examples: + DistributionExamples.getDelegatorRewardsForValidatorNoThrowExample, + similes: + DistributionSimilies.getDelegatorRewardsForValidatorNoThrowSimiles, + functionName: "getDelegatorRewardsForValidatorNoThrow", + validateContent: () => true, + } +); + +export const GetDelegatorRewardsAction = createGenericAction({ + name: "GET_DELEGATOR_REWARDS", + description: "Fetches the rewards for a delegator", + template: DistributionTemplates.getDelegatorRewardsTemplate, + examples: DistributionExamples.getDelegatorRewardsExample, + similes: DistributionSimilies.getDelegatorRewardsSimiles, + functionName: "getDelegatorRewards", + validateContent: () => true, +}); + +export const GetDelegatorRewardsNoThrowAction = createGenericAction({ + name: "GET_DELEGATOR_REWARDS_NO_THROW", + description: "Fetches the rewards for a delegator without throwing errors", + template: DistributionTemplates.getDelegatorRewardsNoThrowTemplate, + examples: DistributionExamples.getDelegatorRewardsNoThrowExample, + similes: DistributionSimilies.getDelegatorRewardsNoThrowSimiles, + functionName: "getDelegatorRewardsNoThrow", + validateContent: () => true, +}); + +export const MsgWithdrawDelegatorRewardAction = createGenericAction({ + name: "MSG_WITHDRAW_DELEGATOR_REWARD", + description: "Withdraws delegator rewards from a specific validator", + template: DistributionTemplates.msgWithdrawDelegatorRewardTemplate, + examples: DistributionExamples.msgWithdrawDelegatorRewardExample, + similes: DistributionSimilies.msgWithdrawDelegatorRewardSimiles, + functionName: "msgWithdrawDelegatorReward", + validateContent: () => true, +}); + +export const MsgWithdrawValidatorCommissionAction = createGenericAction({ + name: "MSG_WITHDRAW_VALIDATOR_COMMISSION", + description: "Withdraws validator commission rewards", + template: DistributionTemplates.msgWithdrawValidatorCommissionTemplate, + examples: DistributionExamples.msgWithdrawValidatorCommissionExample, + similes: DistributionSimilies.msgWithdrawValidatorCommissionSimiles, + functionName: "msgWithdrawValidatorCommission", + validateContent: () => true, +}); + +// Export all actions as a group +export const DistributionActions = [ + GetDistributionModuleParamsAction, + GetDelegatorRewardsForValidatorAction, + GetDelegatorRewardsForValidatorNoThrowAction, + GetDelegatorRewardsAction, + GetDelegatorRewardsNoThrowAction, + MsgWithdrawDelegatorRewardAction, + MsgWithdrawValidatorCommissionAction, +]; diff --git a/packages/plugin-injective/src/action/exchange.ts b/packages/plugin-injective/src/action/exchange.ts new file mode 100644 index 00000000000..ba222a2e7a1 --- /dev/null +++ b/packages/plugin-injective/src/action/exchange.ts @@ -0,0 +1,847 @@ +import { createGenericAction } from "./base"; +import * as ExchangeTemplates from "@injective/template/exchange"; +import * as ExchangeExamples from "@injective/examples/exchange"; +import * as ExchangeSimiles from "@injective/similes/exchange"; +// Module Parameters and State Actions +export const GetModuleParamsAction = createGenericAction({ + name: "GET_MODULE_PARAMS", + description: "Fetches the exchange module parameters", + template: ExchangeTemplates.getModuleParamsTemplate, + examples: ExchangeExamples.getModuleParamsExample, + similes: ExchangeSimiles.getModuleParamsSimiles, + functionName: "getModuleParams", + validateContent: () => true, +}); +// Dont query exchange module state lmao +// export const GetModuleStateAction = createGenericAction({ +// name: "GET_MODULE_STATE", +// description: "Fetches the current state of the exchange module", +// template: ExchangeTemplates.getModuleStateTemplate, +// examples: ExchangeExamples.getModuleStateExample, +// functionName: "getModuleState", +// similes: ExchangeSimiles, +// validateContent: () => true, +// }); + +// Fee Discount Actions +export const GetFeeDiscountScheduleAction = createGenericAction({ + name: "GET_FEE_DISCOUNT_SCHEDULE", + description: "Fetches the fee discount schedule", + template: ExchangeTemplates.getFeeDiscountScheduleTemplate, + examples: ExchangeExamples.getFeeDiscountScheduleExample, + similes: ExchangeSimiles.getFeeDiscountScheduleSimiles, + functionName: "getFeeDiscountSchedule", + validateContent: () => true, +}); + +export const GetFeeDiscountAccountInfoAction = createGenericAction({ + name: "GET_FEE_DISCOUNT_ACCOUNT_INFO", + description: + "Fetches the fee discount information for a specific Injective address", + template: ExchangeTemplates.getFeeDiscountAccountInfoTemplate, + examples: ExchangeExamples.getFeeDiscountAccountInfoExample, + similes: ExchangeSimiles.getFeeDiscountAccountInfoSimiles, + functionName: "getFeeDiscountAccountInfo", + validateContent: () => true, +}); + +// Trading Rewards Actions +export const GetTradingRewardsCampaignAction = createGenericAction({ + name: "GET_TRADING_REWARDS_CAMPAIGN", + description: "Fetches the trading rewards campaign details", + template: ExchangeTemplates.getTradingRewardsCampaignTemplate, + examples: ExchangeExamples.getTradingRewardsCampaignExample, + similes: ExchangeSimiles.getTradingRewardsCampaignSimiles, + functionName: "getTradingRewardsCampaign", + validateContent: () => true, +}); + +export const GetTradeRewardPointsAction = createGenericAction({ + name: "GET_TRADE_REWARD_POINTS", + description: + "Fetches the trade reward points for specified Injective addresses", + template: ExchangeTemplates.getTradeRewardPointsTemplate, + examples: ExchangeExamples.getTradeRewardPointsExample, + similes: ExchangeSimiles.getTradeRewardPointsSimiles, + functionName: "getTradeRewardPoints", + validateContent: () => true, +}); + +export const GetPendingTradeRewardPointsAction = createGenericAction({ + name: "GET_PENDING_TRADE_REWARD_POINTS", + description: + "Fetches pending trade reward points for specified Injective addresses", + template: ExchangeTemplates.getPendingTradeRewardPointsTemplate, + examples: ExchangeExamples.getPendingTradeRewardPointsExample, + similes: ExchangeSimiles.getPendingTradeRewardPointsSimiles, + functionName: "getPendingTradeRewardPoints", + validateContent: () => true, +}); + +// Spot Market Actions +export const GetSpotMarketsAction = createGenericAction({ + name: "GET_SPOT_MARKETS", + description: "Fetches all spot markets", + template: ExchangeTemplates.getSpotMarketsTemplate, + examples: ExchangeExamples.getSpotMarketsExample, + similes: ExchangeSimiles.getSpotMarketSimiles, + functionName: "getSpotMarkets", + validateContent: () => true, +}); + +export const GetSpotMarketAction = createGenericAction({ + name: "GET_SPOT_MARKET", + description: "Fetches a specific spot market by its ID", + template: ExchangeTemplates.getSpotMarketTemplate, + examples: ExchangeExamples.getSpotMarketExample, + similes: ExchangeSimiles.getSpotMarketSimiles, + functionName: "getSpotMarket", + validateContent: () => true, +}); + +export const GetSpotOrdersAction = createGenericAction({ + name: "GET_SPOT_ORDERS", + description: "Fetches all spot orders", + template: ExchangeTemplates.getSpotOrdersTemplate, + examples: ExchangeExamples.getSpotOrdersExample, + similes: ExchangeSimiles.getSpotOrdersSimiles, + functionName: "getSpotOrders", + validateContent: () => true, +}); + +export const GetSpotOrderHistoryAction = createGenericAction({ + name: "GET_SPOT_ORDER_HISTORY", + description: "Fetches the history of spot orders", + template: ExchangeTemplates.getSpotOrderHistoryTemplate, + examples: ExchangeExamples.getSpotOrderHistoryExample, + similes: ExchangeSimiles.getSpotOrderHistorySimiles, + functionName: "getSpotOrderHistory", + validateContent: () => true, +}); + +export const GetSpotTradesAction = createGenericAction({ + name: "GET_SPOT_TRADES", + description: "Fetches all spot trades", + template: ExchangeTemplates.getSpotTradesTemplate, + examples: ExchangeExamples.getSpotTradesExample, + similes: ExchangeSimiles.getSpotTradesSimiles, + functionName: "getSpotTrades", + validateContent: () => true, +}); +//Orderbooks Action +export const GetDerivativeOrderbooksAction = createGenericAction({ + name: "GET_DERIVATIVE_ORDERBOOKS", + description: "Fetches all the derivative or perpetual orderbooks", + template: ExchangeTemplates.getOrderbooksV2Template, + examples: ExchangeExamples.getDerivativeOrderbooksV2Example, + similes: ExchangeSimiles.getDerivativeOrderbookSimiles, + functionName: "getDerivativeOrderbooksV2", + validateContent: () => true, +}); +export const GetDerivativeOrderbookAction = createGenericAction({ + name: "GET_DERIVATIVE_ORDERBOOK", + description: "Fetches a single derivative or perpetual orderbook", + template: ExchangeTemplates.getOrderbookTemplate, + examples: ExchangeExamples.getDerivativeOrderbookV2Example, + similes: ExchangeSimiles.getDerivativeOrderbookSimiles, + functionName: "getDerivativeOrderbookV2", + validateContent: () => true, +}); + +export const GetSpotOrderbooksAction = createGenericAction({ + name: "GET_SPOT_ORDERBOOKS", + description: "Fetches all the spot markets orderbooks", + template: ExchangeTemplates.getOrderbooksV2Template, + examples: ExchangeExamples.getSpotOrderbooksV2Example, + similes: ExchangeSimiles.getSpotOrderbooksSimiles, + functionName: "getSpotOrderbooksV2", + validateContent: () => true, +}); +export const GetSpotOrderbookAction = createGenericAction({ + name: "GET_SPOT_ORDERBOOK", + description: "Fetches a single spot market orderbook", + template: ExchangeTemplates.getOrderbookTemplate, + examples: ExchangeExamples.getSpotOrderbookV2Example, + similes: ExchangeSimiles.getSpotOrderbookSimiles, + functionName: "getSpotOrderbookV2", + validateContent: () => true, +}); + +// Derivative Market Actions +export const GetDerivativeMarketsAction = createGenericAction({ + name: "GET_DERIVATIVE_MARKETS", + description: "Fetches all derivative markets", + template: ExchangeTemplates.getDerivativeMarketsTemplate, + examples: ExchangeExamples.getDerivativeMarketsExample, + similes: ExchangeSimiles.getDerivativeMarketsSimiles, + functionName: "getDerivativeMarkets", + validateContent: () => true, +}); + +export const GetDerivativeMarketAction = createGenericAction({ + name: "GET_DERIVATIVE_MARKET", + description: "Fetches a specific derivative market by its ID", + template: ExchangeTemplates.getDerivativeMarketTemplate, + examples: ExchangeExamples.getDerivativeMarketExample, + similes: ExchangeSimiles.getDerivativeMarketSimiles, + functionName: "getDerivativeMarket", + validateContent: () => true, +}); + +export const GetDerivativeOrdersAction = createGenericAction({ + name: "GET_DERIVATIVE_ORDERS", + description: "Fetches all derivative orders", + template: ExchangeTemplates.getDerivativeOrdersTemplate, + examples: ExchangeExamples.getDerivativeOrdersExample, + similes: ExchangeSimiles.getDerivativeOrdersSimiles, + functionName: "getDerivativeOrders", + validateContent: () => true, +}); + +export const GetDerivativeOrderHistoryAction = createGenericAction({ + name: "GET_DERIVATIVE_ORDER_HISTORY", + description: "Fetches the history of derivative orders", + template: ExchangeTemplates.getDerivativeOrderHistoryTemplate, + examples: ExchangeExamples.getDerivativeOrderHistoryExample, + similes: ExchangeSimiles.getDerivativeOrderHistorySimiles, + functionName: "getDerivativeOrderHistory", + validateContent: () => true, +}); + +export const GetDerivativeTradesAction = createGenericAction({ + name: "GET_DERIVATIVE_TRADES", + description: "Fetches all derivative trades", + template: ExchangeTemplates.getDerivativeTradesTemplate, + examples: ExchangeExamples.getDerivativeTradesExample, + similes: ExchangeSimiles.getDerivativeTradesSimiles, + functionName: "getDerivativeTrades", + validateContent: () => true, +}); + +// Binary Options Actions +export const GetBinaryOptionsMarketsAction = createGenericAction({ + name: "GET_BINARY_OPTIONS_MARKETS", + description: "Fetches all binary options markets", + template: ExchangeTemplates.getBinaryOptionsMarketsTemplate, + examples: ExchangeExamples.getBinaryOptionsMarketsExample, + similes: ExchangeSimiles.getBinaryOptionsMarketsSimiles, + functionName: "getBinaryOptionsMarkets", + validateContent: () => true, +}); + +export const GetBinaryOptionsMarketAction = createGenericAction({ + name: "GET_BINARY_OPTIONS_MARKET", + description: "Fetches a specific binary options market by its ID", + template: ExchangeTemplates.getBinaryOptionsMarketTemplate, + examples: ExchangeExamples.getBinaryOptionsMarketExample, + similes: ExchangeSimiles.getBinaryOptionsMarketSimiles, + functionName: "getBinaryOptionsMarket", + validateContent: () => true, +}); + +// Exchange Positions Actions +export const GetExchangePositionsAction = createGenericAction({ + name: "GET_EXCHANGE_POSITIONS", + description: "Fetches all positions", + template: ExchangeTemplates.getExchangePositionsTemplate, + examples: ExchangeExamples.getExchangePositionsExample, + similes: ExchangeSimiles.getExchangePositionsSimiles, + functionName: "getExchangePositions", + validateContent: () => true, +}); + +export const GetPositionsV2Action = createGenericAction({ + name: "GET_POSITIONS_V2", + description: "Fetches all positions using version 2 of the API", + template: ExchangeTemplates.getPositionsV2Template, + examples: ExchangeExamples.getPositionsV2Example, + similes: ExchangeSimiles.getUserPositionsSimiles, + functionName: "getPositionsV2", + validateContent: () => true, +}); + +// Funding Rate Actions +export const GetFundingPaymentsAction = createGenericAction({ + name: "GET_FUNDING_PAYMENTS", + description: "Fetches all funding payments", + template: ExchangeTemplates.getFundingPaymentsTemplate, + examples: ExchangeExamples.getFundingPaymentsExample, + similes: ExchangeSimiles.getFundingPaymentsSimiles, + functionName: "getFundingPayments", + validateContent: () => true, +}); + +export const GetFundingRatesAction = createGenericAction({ + name: "GET_FUNDING_RATES", + description: "Fetches all funding rates", + template: ExchangeTemplates.getFundingRatesTemplate, + examples: ExchangeExamples.getFundingRatesExample, + similes: ExchangeSimiles.getFundingRatesSimiles, + functionName: "getFundingRates", + validateContent: () => true, +}); + +// Subaccount Actions +export const GetSubaccountTradeNonceAction = createGenericAction({ + name: "GET_SUBACCOUNT_TRADE_NONCE", + description: "Fetches the trade nonce for a specific subaccount", + template: ExchangeTemplates.getSubaccountTradeNonceTemplate, + examples: ExchangeExamples.getSubaccountTradeNonceExample, + similes: ExchangeSimiles.getSubaccountTradeNonceSimiles, + functionName: "getSubaccountTradeNonce", + validateContent: () => true, +}); + +export const GetSubaccountsListAction = createGenericAction({ + name: "GET_SUBACCOUNTS_LIST", + description: "Fetches the list of subaccounts for a specific address", + template: ExchangeTemplates.getSubaccountsListTemplate, + examples: ExchangeExamples.getSubaccountsListExample, + similes: ExchangeSimiles.getSubaccountsListSimiles, + functionName: "getSubaccountsList", + validateContent: () => true, +}); + +export const GetSubaccountBalancesListAction = createGenericAction({ + name: "GET_SUBACCOUNT_BALANCES_LIST", + description: "Fetches the balances list for a specific subaccount", + template: ExchangeTemplates.getSubaccountBalancesListTemplate, + examples: ExchangeExamples.getSubaccountBalancesListExample, + similes: ExchangeSimiles.getSubaccountBalancesListSimiles, + functionName: "getSubaccountBalancesList", + validateContent: () => true, +}); + +export const GetSubaccountHistoryAction = createGenericAction({ + name: "GET_SUBACCOUNT_HISTORY", + description: "Fetches the transfer history of a specific subaccount", + template: ExchangeTemplates.getSubaccountHistoryTemplate, + examples: ExchangeExamples.getSubaccountHistoryExample, + similes: ExchangeSimiles.getSubaccountHistorySimiles, + functionName: "getSubaccountHistory", + validateContent: () => true, +}); + +export const GetSubaccountOrderSummaryAction = createGenericAction({ + name: "GET_SUBACCOUNT_ORDER_SUMMARY", + description: "Fetches the order summary for a specific subaccount", + template: ExchangeTemplates.getSubaccountOrderSummaryTemplate, + examples: ExchangeExamples.getSubaccountOrderSummaryExample, + similes: ExchangeSimiles.getSubaccountOrderSummarySimiles, + functionName: "getSubaccountOrderSummary", + validateContent: () => true, +}); + +// Order Management Actions +export const GetOrderStatesAction = createGenericAction({ + name: "GET_ORDER_STATES", + description: "Fetches the states of orders", + template: ExchangeTemplates.getOrderStatesTemplate, + examples: ExchangeExamples.getOrderStatesExample, + similes: ExchangeSimiles.getOrderStatesSimiles, + functionName: "getOrderStates", + validateContent: () => true, +}); + +// Portfolio Actions +export const GetAccountPortfolioAction = createGenericAction({ + name: "GET_ACCOUNT_PORTFOLIO", + description: "Fetches the account portfolio for a specific address", + template: ExchangeTemplates.getAccountPortfolioTemplate, + examples: ExchangeExamples.getAccountPortfolioExample, + similes: ExchangeSimiles.getAccountPortfolioSimiles, + functionName: "getAccountPortfolio", + validateContent: () => true, +}); + +export const GetAccountPortfolioBalancesAction = createGenericAction({ + name: "GET_ACCOUNT_PORTFOLIO_BALANCES", + description: + "Fetches the balances of the account portfolio for a specific address", + template: ExchangeTemplates.getAccountPortfolioBalancesTemplate, + examples: ExchangeExamples.getAccountPortfolioBalancesExample, + similes: ExchangeSimiles.getAccountPortfolioBalancesSimiles, + functionName: "getAccountPortfolioBalances", + validateContent: () => true, +}); + +// Rewards and Opt-out Actions +export const GetIsOptedOutOfRewardsAction = createGenericAction({ + name: "GET_IS_OPTED_OUT_OF_REWARDS", + description: "Checks if an account is opted out of rewards", + template: ExchangeTemplates.getIsOptedOutOfRewardsTemplate, + examples: ExchangeExamples.getIsOptedOutOfRewardsExample, + similes: ExchangeSimiles.getIsOptedOutOfRewardsSimiles, + functionName: "getIsOptedOutOfRewards", + validateContent: () => true, +}); + +export const GetRewardsAction = createGenericAction({ + name: "GET_REWARDS", + description: "Fetches the rewards for specified Injective addresses", + template: ExchangeTemplates.getRewardsTemplate, + examples: ExchangeExamples.getRewardsExample, + similes: ExchangeSimiles.getRewardsSimiles, + functionName: "getRewards", + validateContent: () => true, +}); + +// Atomic Swap Actions +export const GetAtomicSwapHistoryAction = createGenericAction({ + name: "GET_ATOMIC_SWAP_HISTORY", + description: "Fetches the atomic swap history", + template: ExchangeTemplates.getAtomicSwapHistoryTemplate, + examples: ExchangeExamples.getAtomicSwapHistoryExample, + similes: ExchangeSimiles.getAtomicSwapHistorySimiles, + functionName: "getAtomicSwapHistory", + validateContent: () => true, +}); + +// Grid Strategy Actions +export const GetGridStrategiesAction = createGenericAction({ + name: "GET_GRID_STRATEGIES", + description: "Fetches all grid strategies", + template: ExchangeTemplates.getGridStrategiesTemplate, + examples: ExchangeExamples.getGridStrategiesExample, + similes: ExchangeSimiles.getGridStrategiesSimiles, + functionName: "getGridStrategies", + validateContent: () => true, +}); + +// Historical Data Actions +export const GetHistoricalBalanceAction = createGenericAction({ + name: "GET_HISTORICAL_BALANCE", + description: "Fetches the historical balance", + template: ExchangeTemplates.getHistoricalBalanceTemplate, + examples: ExchangeExamples.getHistoricalBalanceExample, + similes: ExchangeSimiles.getHistoricalBalanceSimiles, + functionName: "getHistoricalBalance", + validateContent: () => true, +}); + +export const GetHistoricalRpnlAction = createGenericAction({ + name: "GET_HISTORICAL_RPNL", + description: "Fetches the historical realized PnL (Rpnl)", + template: ExchangeTemplates.getHistoricalRpnlTemplate, + examples: ExchangeExamples.getHistoricalRpnlExample, + similes: ExchangeSimiles.getHistoricalRpnlSimiles, + functionName: "getHistoricalRpnl", + validateContent: () => true, +}); + +export const GetHistoricalVolumesAction = createGenericAction({ + name: "GET_HISTORICAL_VOLUMES", + description: "Fetches the historical trading volumes", + template: ExchangeTemplates.getHistoricalVolumesTemplate, + examples: ExchangeExamples.getHistoricalVolumesExample, + similes: ExchangeSimiles.getHistoricalVolumesSimiles, + functionName: "getHistoricalVolumes", + validateContent: () => true, +}); + +// Leaderboard Actions +export const GetPnlLeaderboardAction = createGenericAction({ + name: "GET_PNL_LEADERBOARD", + description: "Fetches the PnL leaderboard", + template: ExchangeTemplates.getPnlLeaderboardTemplate, + examples: ExchangeExamples.getPnlLeaderboardExample, + similes: ExchangeSimiles.getPnlLeaderboardSimiles, + functionName: "getPnlLeaderboard", + validateContent: () => true, +}); + +export const GetVolLeaderboardAction = createGenericAction({ + name: "GET_VOL_LEADERBOARD", + description: "Fetches the volume leaderboard", + template: ExchangeTemplates.getVolLeaderboardTemplate, + examples: ExchangeExamples.getVolLeaderboardExample, + similes: ExchangeSimiles.getVolLeaderboardSimiles, + functionName: "getVolLeaderboard", + validateContent: () => true, +}); + +export const GetPnlLeaderboardFixedResolutionAction = createGenericAction({ + name: "GET_PNL_LEADERBOARD_FIXED_RESOLUTION", + description: "Fetches the PnL leaderboard with fixed resolution", + template: ExchangeTemplates.getPnlLeaderboardFixedResolutionTemplate, + examples: ExchangeExamples.getPnlLeaderboardFixedResolutionExample, + similes: ExchangeSimiles.getPnlLeaderboardFixedResolutionSimiles, + functionName: "getPnlLeaderboardFixedResolution", + validateContent: () => true, +}); + +export const GetVolLeaderboardFixedResolutionAction = createGenericAction({ + name: "GET_VOL_LEADERBOARD_FIXED_RESOLUTION", + description: "Fetches the volume leaderboard with fixed resolution", + template: ExchangeTemplates.getVolLeaderboardFixedResolutionTemplate, + examples: ExchangeExamples.getVolLeaderboardFixedResolutionExample, + similes: ExchangeSimiles.getVolLeaderboardFixedResolutionSimiles, + functionName: "getVolLeaderboardFixedResolution", + validateContent: () => true, +}); + +// Denom Holders Action +export const GetDenomHoldersAction = createGenericAction({ + name: "GET_DENOM_HOLDERS", + description: "Fetches the holders of a specific denomination", + template: ExchangeTemplates.getDenomHoldersTemplate, + examples: ExchangeExamples.getDenomHoldersExample, + similes: ExchangeSimiles.getDenomHoldersSimiles, + functionName: "getDenomHolders", + validateContent: () => true, +}); + +// Message Actions for Order Management +export const MsgBatchCancelBinaryOptionsOrdersAction = createGenericAction({ + name: "MSG_BATCH_CANCEL_BINARY_OPTIONS_ORDERS", + description: "Broadcasts a message to batch cancel binary options orders", + template: ExchangeTemplates.msgBatchCancelBinaryOptionsOrdersTemplate, + examples: ExchangeExamples.msgBatchCancelBinaryOptionsOrdersExample, + similes: ExchangeSimiles.msgBatchCancelBinaryOptionsOrdersSimiles, + functionName: "msgBatchCancelBinaryOptionsOrders", + validateContent: () => true, +}); + +export const MsgBatchCancelDerivativeOrdersAction = createGenericAction({ + name: "MSG_BATCH_CANCEL_DERIVATIVE_ORDERS", + description: "Broadcasts a message to batch cancel derivative orders", + template: ExchangeTemplates.msgBatchCancelDerivativeOrdersTemplate, + examples: ExchangeExamples.msgBatchCancelDerivativeOrdersExample, + similes: ExchangeSimiles.msgBatchCancelDerivativeOrdersSimiles, + functionName: "msgBatchCancelDerivativeOrders", + validateContent: () => true, +}); + +export const MsgBatchCancelSpotOrdersAction = createGenericAction({ + name: "MSG_BATCH_CANCEL_SPOT_ORDERS", + description: "Broadcasts a message to batch cancel spot orders", + template: ExchangeTemplates.msgBatchCancelSpotOrdersTemplate, + examples: ExchangeExamples.msgBatchCancelSpotOrdersExample, + similes: ExchangeSimiles.msgBatchCancelSpotOrdersSimiles, + functionName: "msgBatchCancelSpotOrders", + validateContent: () => true, +}); + +export const MsgBatchUpdateOrdersAction = createGenericAction({ + name: "MSG_BATCH_UPDATE_ORDERS", + description: "Broadcasts a message to batch update orders", + template: ExchangeTemplates.msgBatchUpdateOrdersTemplate, + examples: ExchangeExamples.msgBatchUpdateOrdersExample, + similes: ExchangeSimiles.msgBatchUpdateOrdersSimiles, + functionName: "msgBatchUpdateOrders", + validateContent: () => true, +}); + +// Message Actions for Individual Orders +export const MsgCancelBinaryOptionsOrderAction = createGenericAction({ + name: "MSG_CANCEL_BINARY_OPTIONS_ORDER", + description: "Broadcasts a message to cancel a binary options order", + template: ExchangeTemplates.msgCancelBinaryOptionsOrderTemplate, + examples: ExchangeExamples.msgCancelBinaryOptionsOrderExample, + similes: ExchangeSimiles.msgCancelBinaryOptionsOrderSimiles, + functionName: "msgCancelBinaryOptionsOrder", + validateContent: () => true, +}); + +export const MsgCancelDerivativeOrderAction = createGenericAction({ + name: "MSG_CANCEL_DERIVATIVE_ORDER", + description: "Broadcasts a message to cancel a derivative order", + template: ExchangeTemplates.msgCancelDerivativeOrderTemplate, + examples: ExchangeExamples.msgCancelDerivativeOrderExample, + similes: ExchangeSimiles.msgCancelDerivativeOrderSimiles, + functionName: "msgCancelDerivativeOrder", + validateContent: () => true, +}); + +export const MsgCancelSpotOrderAction = createGenericAction({ + name: "MSG_CANCEL_SPOT_ORDER", + description: "Broadcasts a message to cancel a spot order", + template: ExchangeTemplates.msgCancelSpotOrderTemplate, + examples: ExchangeExamples.msgCancelSpotOrderExample, + similes: ExchangeSimiles.msgCancelSpotOrderSimiles, + functionName: "msgCancelSpotOrder", + validateContent: () => true, +}); + +// Message Actions for Creating Orders +export const MsgCreateBinaryOptionsLimitOrderAction = createGenericAction({ + name: "MSG_CREATE_BINARY_OPTIONS_LIMIT_ORDER", + description: "Broadcasts a message to create a binary options limit order", + template: ExchangeTemplates.msgCreateBinaryOptionsLimitOrderTemplate, + examples: ExchangeExamples.msgCreateBinaryOptionsLimitOrderExample, + similes: ExchangeSimiles.msgCreateBinaryOptionsLimitOrderSimiles, + functionName: "msgCreateBinaryOptionsLimitOrder", + validateContent: () => true, +}); + +export const MsgCreateBinaryOptionsMarketOrderAction = createGenericAction({ + name: "MSG_CREATE_BINARY_OPTIONS_MARKET_ORDER", + description: "Broadcasts a message to create a binary options market order", + template: ExchangeTemplates.msgCreateBinaryOptionsMarketOrderTemplate, + examples: ExchangeExamples.msgCreateBinaryOptionsMarketOrderExample, + similes: ExchangeSimiles.msgCreateBinaryOptionsMarketOrderSimiles, + functionName: "msgCreateBinaryOptionsMarketOrder", + validateContent: () => true, +}); + +export const MsgCreateDerivativeLimitOrderAction = createGenericAction({ + name: "MSG_CREATE_DERIVATIVE_LIMIT_ORDER", + description: "Broadcasts a message to create a derivative limit order", + template: ExchangeTemplates.msgCreateDerivativeLimitOrderTemplate, + examples: ExchangeExamples.msgCreateDerivativeLimitOrderExample, + similes: ExchangeSimiles.msgCreateDerivativeLimitOrderSimiles, + functionName: "msgCreateDerivativeLimitOrder", + validateContent: () => true, +}); + +export const MsgCreateDerivativeMarketOrderAction = createGenericAction({ + name: "MSG_CREATE_DERIVATIVE_MARKET_ORDER", + description: "Broadcasts a message to create a derivative market order", + template: ExchangeTemplates.msgCreateDerivativeMarketOrderTemplate, + examples: ExchangeExamples.msgCreateDerivativeMarketOrderExample, + similes: ExchangeSimiles.msgCreateDerivativeMarketOrderSimiles, + functionName: "msgCreateDerivativeMarketOrder", + validateContent: () => true, +}); + +export const MsgCreateSpotLimitOrderAction = createGenericAction({ + name: "MSG_CREATE_SPOT_LIMIT_ORDER", + description: "Broadcasts a message to create a spot limit order", + template: ExchangeTemplates.msgCreateSpotLimitOrderTemplate, + examples: ExchangeExamples.msgCreateSpotLimitOrderExample, + similes: ExchangeSimiles.msgCreateSpotLimitOrderSimiles, + functionName: "msgCreateSpotLimitOrder", + validateContent: () => true, +}); + +export const MsgCreateSpotMarketOrderAction = createGenericAction({ + name: "MSG_CREATE_SPOT_MARKET_ORDER", + description: "Broadcasts a message to create a spot market order", + template: ExchangeTemplates.msgCreateSpotMarketOrderTemplate, + examples: ExchangeExamples.msgCreateSpotMarketOrderExample, + similes: ExchangeSimiles.msgCreateSpotMarketOrderSimiles, + functionName: "msgCreateSpotMarketOrder", + validateContent: () => true, +}); + +// Message Actions for Deposits and Withdrawals +export const MsgDepositAction = createGenericAction({ + name: "MSG_DEPOSIT", + description: "Broadcasts a message to deposit funds", + template: ExchangeTemplates.msgDepositTemplate, + examples: ExchangeExamples.msgDepositExample, + similes: ExchangeSimiles.msgDepositSimiles, + functionName: "msgDeposit", + validateContent: () => true, +}); + +export const MsgWithdrawAction = createGenericAction({ + name: "MSG_WITHDRAW", + description: "Broadcasts a message to withdraw funds", + template: ExchangeTemplates.msgWithdrawTemplate, + examples: ExchangeExamples.msgWithdrawExample, + similes: ExchangeSimiles.msgWithdrawSimiles, + functionName: "msgWithdraw", + validateContent: () => true, +}); + +// Message Actions for Position Management +export const MsgIncreasePositionMarginAction = createGenericAction({ + name: "MSG_INCREASE_POSITION_MARGIN", + description: "Broadcasts a message to increase position margin", + template: ExchangeTemplates.msgIncreasePositionMarginTemplate, + examples: ExchangeExamples.msgIncreasePositionMarginExample, + similes: ExchangeSimiles.msgIncreasePositionMarginSimiles, + functionName: "msgIncreasePositionMargin", + validateContent: () => true, +}); + +// Message Actions for Market Administration +export const MsgInstantSpotMarketLaunchAction = createGenericAction({ + name: "MSG_INSTANT_SPOT_MARKET_LAUNCH", + description: "Broadcasts a message to instantly launch a spot market", + template: ExchangeTemplates.msgInstantSpotMarketLaunchTemplate, + examples: ExchangeExamples.msgInstantSpotMarketLaunchExample, + similes: ExchangeSimiles.msgInstantSpotMarketLaunchSimiles, + functionName: "msgInstantSpotMarketLaunch", + validateContent: () => true, +}); + +export const MsgLiquidatePositionAction = createGenericAction({ + name: "MSG_LIQUIDATE_POSITION", + description: "Broadcasts a message to liquidate a position", + template: ExchangeTemplates.msgLiquidatePositionTemplate, + examples: ExchangeExamples.msgLiquidatePositionExample, + similes: ExchangeSimiles.msgLiquidatePositionSimiles, + functionName: "msgLiquidatePosition", + validateContent: () => true, +}); + +export const MsgReclaimLockedFundsAction = createGenericAction({ + name: "MSG_RECLAIM_LOCKED_FUNDS", + description: "Broadcasts a message to reclaim locked funds", + template: ExchangeTemplates.msgReclaimLockedFundsTemplate, + examples: ExchangeExamples.msgReclaimLockedFundsExample, + similes: ExchangeSimiles.msgReclaimLockedFundsSimiles, + functionName: "msgReclaimLockedFunds", + validateContent: () => true, +}); + +export const MsgRewardsOptOutAction = createGenericAction({ + name: "MSG_REWARDS_OPT_OUT", + description: "Broadcasts a message to opt out of rewards", + template: ExchangeTemplates.msgRewardsOptOutTemplate, + examples: ExchangeExamples.msgRewardsOptOutExample, + similes: ExchangeSimiles.msgRewardsOptOutSimiles, + functionName: "msgRewardsOptOut", + validateContent: () => true, +}); + +export const MsgSignDataAction = createGenericAction({ + name: "MSG_SIGN_DATA", + description: "Broadcasts a message to sign data", + template: ExchangeTemplates.msgSignDataTemplate, + examples: ExchangeExamples.msgSignDataExample, + similes: ExchangeSimiles.msgSignDataSimiles, + functionName: "msgSignData", + validateContent: () => true, +}); + +export const MsgExternalTransferAction = createGenericAction({ + name: "MSG_EXTERNAL_TRANSFER", + description: "Broadcasts a message to perform an external transfer", + template: ExchangeTemplates.msgExternalTransferTemplate, + examples: ExchangeExamples.msgExternalTransferExample, + similes: ExchangeSimiles.msgExternalTransferSimiles, + functionName: "msgExternalTransfer", + validateContent: () => true, +}); + +export const MsgAdminUpdateBinaryOptionsMarketAction = createGenericAction({ + name: "MSG_ADMIN_UPDATE_BINARY_OPTIONS_MARKET", + description: + "Broadcasts a message to update a binary options market as an admin", + template: ExchangeTemplates.msgAdminUpdateBinaryOptionsMarketTemplate, + examples: ExchangeExamples.msgAdminUpdateBinaryOptionsMarketExample, + functionName: "msgAdminUpdateBinaryOptionsMarket", + similes: ExchangeSimiles.msgAdminUpdateBinaryOptionsMarketSimiles, + validateContent: () => true, +}); + +// Export all actions as a group +export const ExchangeActions = [ + // Module Parameters and State + GetModuleParamsAction, + + // Fee Discount + GetFeeDiscountScheduleAction, + GetFeeDiscountAccountInfoAction, + + // Trading Rewards + GetTradingRewardsCampaignAction, + GetTradeRewardPointsAction, + GetPendingTradeRewardPointsAction, + + // Orderbooks + GetDerivativeOrderbooksAction, + GetDerivativeOrderbookAction, + GetSpotOrderbooksAction, + GetSpotOrderbookAction, + + // Spot Market + GetSpotMarketsAction, + GetSpotMarketAction, + GetSpotOrdersAction, + GetSpotOrderHistoryAction, + GetSpotTradesAction, + + // Derivative Market + GetDerivativeMarketsAction, + GetDerivativeMarketAction, + GetDerivativeOrdersAction, + GetDerivativeOrderHistoryAction, + GetDerivativeTradesAction, + + // Binary Options + GetBinaryOptionsMarketsAction, + GetBinaryOptionsMarketAction, + + // Positions + GetExchangePositionsAction, + GetPositionsV2Action, + + // Funding + GetFundingPaymentsAction, + GetFundingRatesAction, + + // Subaccount + GetSubaccountTradeNonceAction, + GetSubaccountsListAction, + GetSubaccountBalancesListAction, + GetSubaccountHistoryAction, + GetSubaccountOrderSummaryAction, + + // Order Management + GetOrderStatesAction, + + // Portfolio + GetAccountPortfolioAction, + GetAccountPortfolioBalancesAction, + + // Rewards and Opt-out + GetIsOptedOutOfRewardsAction, + GetRewardsAction, + + // Atomic Swap + GetAtomicSwapHistoryAction, + + // Grid Strategy + GetGridStrategiesAction, + + // Historical Data + GetHistoricalBalanceAction, + GetHistoricalRpnlAction, + GetHistoricalVolumesAction, + + // Leaderboard + GetPnlLeaderboardAction, + GetVolLeaderboardAction, + GetPnlLeaderboardFixedResolutionAction, + GetVolLeaderboardFixedResolutionAction, + + // Denom Holders + GetDenomHoldersAction, + + // Message Actions - Order Management + MsgBatchCancelBinaryOptionsOrdersAction, + MsgBatchCancelDerivativeOrdersAction, + MsgBatchCancelSpotOrdersAction, + MsgBatchUpdateOrdersAction, + MsgCancelBinaryOptionsOrderAction, + MsgCancelDerivativeOrderAction, + MsgCancelSpotOrderAction, + + // Message Actions - Creating Orders + MsgCreateBinaryOptionsLimitOrderAction, + MsgCreateBinaryOptionsMarketOrderAction, + MsgCreateDerivativeLimitOrderAction, + MsgCreateDerivativeMarketOrderAction, + MsgCreateSpotLimitOrderAction, + MsgCreateSpotMarketOrderAction, + + // Message Actions - Deposits and Withdrawals + MsgDepositAction, + MsgWithdrawAction, + + // Message Actions - Position Management + MsgIncreasePositionMarginAction, + MsgInstantSpotMarketLaunchAction, + MsgLiquidatePositionAction, + + // Message Actions - Administration and Utils + MsgReclaimLockedFundsAction, + MsgRewardsOptOutAction, + MsgSignDataAction, + MsgExternalTransferAction, + MsgAdminUpdateBinaryOptionsMarketAction, +]; diff --git a/packages/plugin-injective/src/action/explorer.ts b/packages/plugin-injective/src/action/explorer.ts new file mode 100644 index 00000000000..5b7d5b029ec --- /dev/null +++ b/packages/plugin-injective/src/action/explorer.ts @@ -0,0 +1,129 @@ +// src/actions/explorer/explorer-actions.ts +import { createGenericAction } from "./base"; +import * as ExplorerTemplates from "@injective/template/explorer"; +import * as ExplorerExamples from "@injective/examples/explorer"; +import * as ExplorerSimiles from "@injective/similes/explorer"; +export const GetTxByHashAction = createGenericAction({ + name: "GET_TX_BY_HASH", + description: "Fetches a transaction by its hash", + template: ExplorerTemplates.getTxByHashTemplate, + examples: ExplorerExamples.getTxByHashExample, + similes: ExplorerSimiles.getTxByHashSimiles, + functionName: "getTxByHash", + validateContent: () => true, +}); + +export const GetAccountTxAction = createGenericAction({ + name: "GET_ACCOUNT_TX", + description: "Fetches transactions for a specific account", + template: ExplorerTemplates.getAccountTxTemplate, + examples: ExplorerExamples.getAccountTxExample, + similes: ExplorerSimiles.getAccountTxSimiles, + functionName: "getAccountTx", + validateContent: () => true, +}); + +export const GetExplorerValidatorAction = createGenericAction({ + name: "GET_EXPLORER_VALIDATOR", + description: "Fetches details of a specific validator", + template: ExplorerTemplates.getValidatorTemplate, + examples: ExplorerExamples.getValidatorExample, + similes: ExplorerSimiles.getExplorerValidatorSimiles, + functionName: "getValidator", + validateContent: () => true, +}); + +export const GetValidatorUptimeAction = createGenericAction({ + name: "GET_VALIDATOR_UPTIME", + description: "Fetches the uptime of a specific validator", + template: ExplorerTemplates.getValidatorUptimeTemplate, + examples: ExplorerExamples.getValidatorUptimeExample, + similes: ExplorerSimiles.getExplorerValidatorUptimeSimiles, + functionName: "getValidatorUptime", + validateContent: () => true, +}); + +export const GetPeggyDepositTxsAction = createGenericAction({ + name: "GET_PEGGY_DEPOSIT_TXS", + description: "Fetches Peggy deposit transactions", + template: ExplorerTemplates.getPeggyDepositTxsTemplate, + examples: ExplorerExamples.getPeggyDepositTxsExample, + similes: ExplorerSimiles.getPeggyDepositTxsSimiles, + functionName: "getPeggyDepositTxs", + validateContent: () => true, +}); + +export const GetPeggyWithdrawalTxsAction = createGenericAction({ + name: "GET_PEGGY_WITHDRAWAL_TXS", + description: "Fetches Peggy withdrawal transactions", + template: ExplorerTemplates.getPeggyWithdrawalTxsTemplate, + examples: ExplorerExamples.getPeggyWithdrawalTxsExample, + similes: ExplorerSimiles.getPeggyWithdrawalTxsSimiles, + functionName: "getPeggyWithdrawalTxs", + validateContent: () => true, +}); + +export const GetBlocksAction = createGenericAction({ + name: "GET_BLOCKS", + description: "Fetches a list of blocks based on provided parameters", + template: ExplorerTemplates.getBlocksTemplate, + examples: ExplorerExamples.getBlocksExample, + similes: ExplorerSimiles.getBlocksSimiles, + functionName: "getBlocks", + validateContent: () => true, +}); + +export const GetBlockAction = createGenericAction({ + name: "GET_BLOCK", + description: "Fetches details of a specific block by its ID", + template: ExplorerTemplates.getBlockTemplate, + examples: ExplorerExamples.getBlockExample, + similes: ExplorerSimiles.getBlockSimiles, + functionName: "getBlock", + validateContent: () => true, +}); + +export const GetTxsAction = createGenericAction({ + name: "GET_TXS", + description: "Fetches a list of transactions based on provided parameters", + template: ExplorerTemplates.getTxsTemplate, + examples: ExplorerExamples.getTxsExample, + similes: ExplorerSimiles.getTxsSimiles, + functionName: "getTxs", + validateContent: () => true, +}); + +export const GetIBCTransferTxsAction = createGenericAction({ + name: "GET_IBC_TRANSFER_TXS", + description: "Fetches IBC transfer transactions", + template: ExplorerTemplates.getIBCTransferTxsTemplate, + examples: ExplorerExamples.getIBCTransferTxsExample, + similes: ExplorerSimiles.getIBCTransferTxsSimiles, + functionName: "getIBCTransferTxs", + validateContent: () => true, +}); + +export const GetExplorerStatsAction = createGenericAction({ + name: "GET_EXPLORER_STATS", + description: "Fetches explorer statistics", + template: ExplorerTemplates.getExplorerStatsTemplate, + examples: ExplorerExamples.getExplorerStatsExample, + similes: ExplorerSimiles.getExplorerStatsSimiles, + functionName: "getExplorerStats", + validateContent: () => true, +}); + +// Export all actions as a group +export const ExplorerActions = [ + GetTxByHashAction, + GetAccountTxAction, + GetExplorerValidatorAction, + GetValidatorUptimeAction, + GetPeggyDepositTxsAction, + GetPeggyWithdrawalTxsAction, + GetBlocksAction, + GetBlockAction, + GetTxsAction, + GetIBCTransferTxsAction, + GetExplorerStatsAction, +]; diff --git a/packages/plugin-injective/src/action/gov.ts b/packages/plugin-injective/src/action/gov.ts new file mode 100644 index 00000000000..5698c5d2d29 --- /dev/null +++ b/packages/plugin-injective/src/action/gov.ts @@ -0,0 +1,169 @@ +// src/actions/governance/governance-actions.ts +import { createGenericAction } from "./base"; +import * as GovTemplates from "@injective/template/gov"; +import * as GovExamples from "@injective/examples/gov"; +import * as GovSimiles from "@injective/similes/gov"; +export const GetGovernanceModuleParamsAction = createGenericAction({ + name: "GET_GOVERNANCE_MODULE_PARAMS", + description: "Fetches the governance module parameters", + template: GovTemplates.getGovernanceModuleParamsTemplate, + examples: GovExamples.getGovernanceModuleParamsExample, + functionName: "getGovernanceModuleParams", + similes: GovSimiles.getGovernanceModuleParamsSimiles, + validateContent: () => true, +}); + +export const GetProposalsAction = createGenericAction({ + name: "GET_PROPOSALS", + description: "Fetches a list of proposals based on provided parameters", + template: GovTemplates.getProposalsTemplate, + examples: GovExamples.getProposalsExample, + functionName: "getProposals", + similes: GovSimiles.getProposalsSimiles, + validateContent: () => true, +}); + +export const GetProposalAction = createGenericAction({ + name: "GET_PROPOSAL", + description: "Fetches details of a specific proposal by its ID", + template: GovTemplates.getProposalTemplate, + examples: GovExamples.getProposalExample, + similes: GovSimiles.getProposalsSimiles, + functionName: "getProposal", + validateContent: () => true, +}); + +export const GetProposalDepositsAction = createGenericAction({ + name: "GET_PROPOSAL_DEPOSITS", + description: "Fetches deposits for a specific proposal", + template: GovTemplates.getProposalDepositsTemplate, + examples: GovExamples.getProposalDepositsExample, + similes: GovSimiles.getProposalDepositsSimiles, + functionName: "getProposalDeposits", + validateContent: () => true, +}); + +export const GetProposalVotesAction = createGenericAction({ + name: "GET_PROPOSAL_VOTES", + description: "Fetches votes for a specific proposal", + template: GovTemplates.getProposalVotesTemplate, + examples: GovExamples.getProposalVotesExample, + similes: GovSimiles.getProposalVotesSimiles, + functionName: "getProposalVotes", + validateContent: () => true, +}); + +export const GetProposalTallyAction = createGenericAction({ + name: "GET_PROPOSAL_TALLY", + description: "Fetches the tally results of a specific proposal", + template: GovTemplates.getProposalTallyTemplate, + examples: GovExamples.getProposalTallyExample, + similes: GovSimiles.getProposalTallySimiles, + functionName: "getProposalTally", + validateContent: () => true, +}); + +// Message Actions +export const MsgSubmitProposalExpiryFuturesMarketLaunchAction = + createGenericAction({ + name: "MSG_SUBMIT_PROPOSAL_EXPIRY_FUTURES_MARKET_LAUNCH", + description: "Submits a proposal to launch an expiry futures market", + template: + GovTemplates.msgSubmitProposalExpiryFuturesMarketLaunchTemplate, + examples: GovExamples.msgSubmitProposalExpiryFuturesMarketLaunchExample, + similes: GovSimiles.msgSubmitProposalExpiryFuturesMarketLaunchSimiles, + functionName: "msgSubmitProposalExpiryFuturesMarketLaunch", + validateContent: () => true, + }); + +export const MsgSubmitProposalSpotMarketLaunchAction = createGenericAction({ + name: "MSG_SUBMIT_PROPOSAL_SPOT_MARKET_LAUNCH", + description: "Submits a proposal to launch a spot market", + template: GovTemplates.msgSubmitProposalSpotMarketLaunchTemplate, + examples: GovExamples.msgSubmitProposalSpotMarketLaunchExample, + similes: GovSimiles.msgSubmitProposalSpotMarketLaunchSimiles, + functionName: "msgSubmitProposalSpotMarketLaunch", + validateContent: () => true, +}); + +export const MsgSubmitProposalPerpetualMarketLaunchAction = createGenericAction( + { + name: "MSG_SUBMIT_PROPOSAL_PERPETUAL_MARKET_LAUNCH", + description: "Submits a proposal to launch a perpetual market", + template: GovTemplates.msgSubmitProposalPerpetualMarketLaunchTemplate, + examples: GovExamples.msgSubmitProposalPerpetualMarketLaunchExample, + similes: GovSimiles.msgSubmitProposalPerpetualMarketLaunchSimiles, + functionName: "msgSubmitProposalPerpetualMarketLaunch", + validateContent: () => true, + } +); + +export const MsgVoteAction = createGenericAction({ + name: "MSG_VOTE", + description: "Casts a vote on a specific proposal", + template: GovTemplates.msgVoteTemplate, + examples: GovExamples.msgVoteExample, + similes: GovSimiles.msgVoteSimiles, + functionName: "msgVote", + validateContent: () => true, +}); + +export const MsgSubmitTextProposalAction = createGenericAction({ + name: "MSG_SUBMIT_TEXT_PROPOSAL", + description: "Submits a text-based proposal", + template: GovTemplates.msgSubmitTextProposalTemplate, + examples: GovExamples.msgSubmitTextProposalExample, + similes: GovSimiles.msgSubmitTextProposalSimiles, + functionName: "msgSubmitTextProposal", + validateContent: () => true, +}); + +export const MsgSubmitProposalSpotMarketParamUpdateAction = createGenericAction( + { + name: "MSG_SUBMIT_PROPOSAL_SPOT_MARKET_PARAM_UPDATE", + description: "Submits a proposal to update spot market parameters", + template: GovTemplates.msgSubmitProposalSpotMarketParamUpdateTemplate, + examples: GovExamples.msgSubmitProposalSpotMarketParamUpdateExample, + similes: GovSimiles.msgSubmitProposalSpotMarketParamUpdateSimiles, + functionName: "msgSubmitProposalSpotMarketParamUpdate", + validateContent: () => true, + } +); + +export const MsgSubmitGenericProposalAction = createGenericAction({ + name: "MSG_SUBMIT_GENERIC_PROPOSAL", + description: "Submits a generic proposal", + template: GovTemplates.msgSubmitGenericProposalTemplate, + examples: GovExamples.msgSubmitGenericProposalExample, + similes: GovSimiles.msgSubmitGenericProposalSimiles, + functionName: "msgSubmitGenericProposal", + validateContent: () => true, +}); + +export const MsgGovDepositAction = createGenericAction({ + name: "MSG_GOV_DEPOSIT", + description: "Deposits tokens to a specific proposal", + similes: GovSimiles.msgGovDepositSimiles, + template: GovTemplates.msgGovDepositTemplate, + examples: GovExamples.msgGovDepositExample, + functionName: "msgGovDeposit", + validateContent: () => true, +}); + +// Export all actions as a group +export const GovActions = [ + GetGovernanceModuleParamsAction, + GetProposalsAction, + GetProposalAction, + GetProposalDepositsAction, + GetProposalVotesAction, + GetProposalTallyAction, + MsgSubmitProposalExpiryFuturesMarketLaunchAction, + MsgSubmitProposalSpotMarketLaunchAction, + MsgSubmitProposalPerpetualMarketLaunchAction, + MsgVoteAction, + MsgSubmitTextProposalAction, + MsgSubmitProposalSpotMarketParamUpdateAction, + MsgSubmitGenericProposalAction, + MsgGovDepositAction, +]; diff --git a/packages/plugin-injective/src/action/ibc.ts b/packages/plugin-injective/src/action/ibc.ts new file mode 100644 index 00000000000..09c9eff7645 --- /dev/null +++ b/packages/plugin-injective/src/action/ibc.ts @@ -0,0 +1,41 @@ +import { createGenericAction } from "./base"; +import * as IBCTemplates from "@injective/template/ibc"; +import * as IBCExamples from "@injective/examples/ibc"; +import * as IBCSimiles from "@injective/similes/ibc"; +export const GetDenomTraceAction = createGenericAction({ + name: "GET_DENOM_TRACE", + description: "Fetches the denomination trace for a specific hash", + template: IBCTemplates.getDenomTraceTemplate, + examples: IBCExamples.getDenomTraceExample, + similes: IBCSimiles.getDenomTraceSimiles, + functionName: "getDenomTrace", + validateContent: () => true, +}); + +export const GetDenomsTraceAction = createGenericAction({ + name: "GET_DENOMS_TRACE", + description: + "Fetches a list of denomination traces with optional pagination", + template: IBCTemplates.getDenomsTraceTemplate, + examples: IBCExamples.getDenomsTraceExample, + similes: IBCSimiles.getDenomsTraceSimiles, + functionName: "getDenomsTrace", + validateContent: () => true, +}); + +export const MsgIBCTransferAction = createGenericAction({ + name: "MSG_IBC_TRANSFER", + description: "Broadcasts an IBC transfer message", + template: IBCTemplates.msgIBCTransferTemplate, + examples: IBCExamples.msgIBCTransferExample, + similes: IBCSimiles.msgIBCTransferSimiles, + functionName: "msgIBCTransfer", + validateContent: () => true, +}); + +// Export all actions as a group +export const IbcActions = [ + GetDenomTraceAction, + GetDenomsTraceAction, + MsgIBCTransferAction, +]; diff --git a/packages/plugin-injective/src/action/index.ts b/packages/plugin-injective/src/action/index.ts new file mode 100644 index 00000000000..210527f612f --- /dev/null +++ b/packages/plugin-injective/src/action/index.ts @@ -0,0 +1,54 @@ +import { AuctionActions } from "./auction"; +import { AuthActions } from "./auth"; +import { BankActions } from "./bank"; +import { DistributionActions } from "./distribution"; +import { ExchangeActions } from "./exchange"; +import { ExplorerActions } from "./explorer"; +import { GovActions } from "./gov"; +import { IbcActions } from "./ibc"; +import { InsuranceActions } from "./insurance"; +import { MintActions } from "./mint"; +import { MitoActions } from "./mito"; +import { PeggyActions } from "./peggy"; +import { PermissionsActions } from "./permissions"; +import { StakingActions } from "./staking"; +import { TokenFactoryActions } from "./token-factory"; +import { WasmActions } from "./wasm"; +// Exporting all actions +export * from "./auction"; +export * from "./auth"; +export * from "./bank"; +export * from "./distribution"; +export * from "./exchange"; +export * from "./explorer"; +export * from "./gov"; +export * from "./ibc"; +export * from "./insurance"; +export * from "./mint"; +export * from "./mito"; +export * from "./peggy"; +export * from "./permissions"; +export * from "./staking"; +export * from "./token-factory"; +export * from "./wasm"; + +export const InjectiveActions = [ + ...ExchangeActions, + ...AuctionActions, + ...AuthActions, + ...BankActions, + ...DistributionActions, + ...ExplorerActions, + ...GovActions, + ...IbcActions, + ...InsuranceActions, + ...MintActions, + ...MitoActions, + ...PeggyActions, + ...PermissionsActions, + ...StakingActions, + ...TokenFactoryActions, + ...WasmActions, +]; + +export default InjectiveActions; diff --git a/packages/plugin-injective/src/action/insurance.ts b/packages/plugin-injective/src/action/insurance.ts new file mode 100644 index 00000000000..c1298910c80 --- /dev/null +++ b/packages/plugin-injective/src/action/insurance.ts @@ -0,0 +1,99 @@ +import { createGenericAction } from "./base"; +import * as InsuranceTemplates from "@injective/template/insurance"; +import * as InsuranceExamples from "@injective/examples/insurance"; +import * as InsuranceSimiles from "@injective/similes/insurance"; +// Query Actions +export const GetInsuranceModuleParamsAction = createGenericAction({ + name: "GET_INSURANCE_MODULE_PARAMS", + description: "Fetches the insurance module parameters", + template: InsuranceTemplates.getInsuranceModuleParamsTemplate, + examples: InsuranceExamples.getInsuranceModuleParamsExample, + similes: InsuranceSimiles.getInsuranceModuleParamsSimiles, + functionName: "getInsuranceModuleParams", + validateContent: () => true, +}); + +export const GetInsuranceFundsAction = createGenericAction({ + name: "GET_INSURANCE_FUNDS", + description: "Fetches a list of all insurance funds", + template: InsuranceTemplates.getInsuranceFundsTemplate, + examples: InsuranceExamples.getInsuranceFundsExample, + similes: InsuranceSimiles.getInsuranceFundsSimiles, + functionName: "getInsuranceFunds", + validateContent: () => true, +}); + +export const GetInsuranceFundAction = createGenericAction({ + name: "GET_INSURANCE_FUND", + description: + "Fetches details of a specific insurance fund by its market ID", + template: InsuranceTemplates.getInsuranceFundTemplate, + examples: InsuranceExamples.getInsuranceFundExample, + similes: InsuranceSimiles.getInsuranceFundSimiles, + functionName: "getInsuranceFund", + validateContent: () => true, +}); + +export const GetEstimatedRedemptionsAction = createGenericAction({ + name: "GET_ESTIMATED_REDEMPTIONS", + description: "Fetches estimated redemptions based on provided parameters", + template: InsuranceTemplates.getEstimatedRedemptionsTemplate, + examples: InsuranceExamples.getEstimatedRedemptionsExample, + similes: InsuranceSimiles.getEstimatedRedemptionsSimiles, + functionName: "getEstimatedRedemptions", + validateContent: () => true, +}); + +export const GetPendingRedemptionsAction = createGenericAction({ + name: "GET_PENDING_REDEMPTIONS", + description: "Fetches pending redemptions based on provided parameters", + template: InsuranceTemplates.getPendingRedemptionsTemplate, + examples: InsuranceExamples.getPendingRedemptionsExample, + similes: InsuranceSimiles.getPendingRedemptionsSimiles, + functionName: "getPendingRedemptions", + validateContent: () => true, +}); + +// Message Actions +export const MsgCreateInsuranceFundAction = createGenericAction({ + name: "MSG_CREATE_INSURANCE_FUND", + description: "Broadcasts a message to create a new insurance fund", + template: InsuranceTemplates.msgCreateInsuranceFundTemplate, + examples: InsuranceExamples.msgCreateInsuranceFundExample, + similes: InsuranceSimiles.msgCreateInsuranceFundSimiles, + functionName: "msgCreateInsuranceFund", + validateContent: () => true, +}); + +export const MsgRequestRedemptionAction = createGenericAction({ + name: "MSG_REQUEST_REDEMPTION", + description: + "Broadcasts a message to request a redemption from an insurance fund", + template: InsuranceTemplates.msgRequestRedemptionTemplate, + examples: InsuranceExamples.msgRequestRedemptionExample, + similes: InsuranceSimiles.msgRequestRedemptionSimiles, + functionName: "msgRequestRedemption", + validateContent: () => true, +}); + +export const MsgUnderwriteAction = createGenericAction({ + name: "MSG_UNDERWRITE", + description: "Broadcasts a message to underwrite an insurance fund", + template: InsuranceTemplates.msgUnderwriteTemplate, + examples: InsuranceExamples.msgUnderwriteExample, + similes: InsuranceSimiles.msgUnderwriteSimiles, + functionName: "msgUnderwrite", + validateContent: () => true, +}); + +// Export all actions as a group +export const InsuranceActions = [ + GetInsuranceModuleParamsAction, + GetInsuranceFundsAction, + GetInsuranceFundAction, + GetEstimatedRedemptionsAction, + GetPendingRedemptionsAction, + MsgCreateInsuranceFundAction, + MsgRequestRedemptionAction, + MsgUnderwriteAction, +]; diff --git a/packages/plugin-injective/src/action/mint.ts b/packages/plugin-injective/src/action/mint.ts new file mode 100644 index 00000000000..a66fb7d64ce --- /dev/null +++ b/packages/plugin-injective/src/action/mint.ts @@ -0,0 +1,40 @@ +import { createGenericAction } from "./base"; +import * as MintTemplates from "@injective/template/mint"; +import * as MintExamples from "@injective/examples/mint"; +import * as MintSimiles from "@injective/similes/mint"; +export const GetMintModuleParamsAction = createGenericAction({ + name: "GET_MINT_MODULE_PARAMS", + description: "Fetches the parameters of the Mint module", + template: MintTemplates.getMintModuleParamsTemplate, + examples: MintExamples.getMintModuleParamsExample, + similes: MintSimiles.getMintModuleParamsSimiles, + functionName: "getMintModuleParams", + validateContent: () => true, +}); + +export const GetInflationAction = createGenericAction({ + name: "GET_INFLATION", + description: "Retrieves the current inflation rate", + template: MintTemplates.getInflationTemplate, + examples: MintExamples.getInflationExample, + similes: MintSimiles.getInflationSimiles, + functionName: "getInflation", + validateContent: () => true, +}); + +export const GetAnnualProvisionsAction = createGenericAction({ + name: "GET_ANNUAL_PROVISIONS", + description: "Obtains the annual provisions", + template: MintTemplates.getAnnualProvisionsTemplate, + examples: MintExamples.getAnnualProvisionsExample, + similes: MintSimiles.getAnnualProvisionsSimiles, + functionName: "getAnnualProvisions", + validateContent: () => true, +}); + +// Export all actions as a group +export const MintActions = [ + GetMintModuleParamsAction, + GetInflationAction, + GetAnnualProvisionsAction, +]; diff --git a/packages/plugin-injective/src/action/mito.ts b/packages/plugin-injective/src/action/mito.ts new file mode 100644 index 00000000000..8895499611b --- /dev/null +++ b/packages/plugin-injective/src/action/mito.ts @@ -0,0 +1,347 @@ +import { createGenericAction } from "./base"; +import * as MitoTemplates from "@injective/template/mito"; +import * as MitoExamples from "@injective/examples/mito"; +import * as MitoSimiles from "@injective/similes/mito"; +// Vault Related Actions +export const GetVaultAction = createGenericAction({ + name: "GET_VAULT", + description: "Fetches the details of a specific vault", + template: MitoTemplates.getVaultTemplate, + examples: MitoExamples.getVaultExample, + similes: MitoSimiles.getVaultSimiles, + functionName: "getVault", + validateContent: () => true, +}); + +export const GetVaultsAction = createGenericAction({ + name: "GET_VAULTS", + description: "Fetches a list of all vaults with optional filtering", + template: MitoTemplates.getVaultsTemplate, + examples: MitoExamples.getVaultsExample, + similes: MitoSimiles.getVaultSimiles, + functionName: "getVaults", + validateContent: () => true, +}); + +export const GetVaultsByHolderAddressAction = createGenericAction({ + name: "GET_VAULTS_BY_HOLDER_ADDRESS", + description: "Fetches vaults associated with a specific holder address", + template: MitoTemplates.getVaultsByHolderAddressTemplate, + examples: MitoExamples.getVaultsByHolderAddressExample, + similes: MitoSimiles.getVaultsByHolderAddressSimiles, + functionName: "getVaultsByHolderAddress", + validateContent: () => true, +}); + +// LP Token Related Actions +export const GetLpTokenPriceChartAction = createGenericAction({ + name: "GET_LP_TOKEN_PRICE_CHART", + description: "Retrieves the price chart data for LP tokens", + template: MitoTemplates.getLpTokenPriceChartTemplate, + examples: MitoExamples.getLpTokenPriceChartExample, + similes: MitoSimiles.getLpTokenPriceChartSimiles, + functionName: "getLpTokenPriceChart", + validateContent: () => true, +}); + +export const GetLPHoldersAction = createGenericAction({ + name: "GET_LP_HOLDERS", + description: "Retrieves a list of LP token holders", + template: MitoTemplates.getLPHoldersTemplate, + examples: MitoExamples.getLPHoldersExample, + similes: MitoSimiles.getLPHoldersSimiles, + functionName: "getLPHolders", + validateContent: () => true, +}); + +// TVL and Portfolio Actions +export const GetTVLChartAction = createGenericAction({ + name: "GET_TVL_CHART", + description: "Retrieves the Total Value Locked (TVL) chart data", + template: MitoTemplates.getTVLChartTemplate, + examples: MitoExamples.getTVLChartExample, + similes: MitoSimiles.getTVLChartSimiles, + functionName: "getTVLChart", + validateContent: () => true, +}); + +export const GetHolderPortfolioAction = createGenericAction({ + name: "GET_HOLDER_PORTFOLIO", + description: "Retrieves the portfolio details of a specific holder", + template: MitoTemplates.getHolderPortfolioTemplate, + examples: MitoExamples.getHolderPortfolioExample, + similes: MitoSimiles.getHolderPortfolioSimiles, + functionName: "getHolderPortfolio", + validateContent: () => true, +}); + +// Leaderboard Related Actions +export const GetLeaderboardAction = createGenericAction({ + name: "GET_LEADERBOARD", + description: "Retrieves the leaderboard for a specific epoch", + template: MitoTemplates.getLeaderboardTemplate, + examples: MitoExamples.getLeaderboardExample, + similes: MitoSimiles.getLeaderboardSimiles, + functionName: "getLeaderboard", + validateContent: () => true, +}); + +export const GetLeaderboardEpochsAction = createGenericAction({ + name: "GET_LEADERBOARD_EPOCHS", + description: "Retrieves the epochs associated with leaderboards", + template: MitoTemplates.getLeaderboardEpochsTemplate, + examples: MitoExamples.getLeaderboardEpochsExample, + similes: MitoSimiles.getLeaderboardEpochsSimiles, + functionName: "getLeaderboardEpochs", + validateContent: () => true, +}); + +// Transfer and History Actions +export const GetTransferHistoryAction = createGenericAction({ + name: "GET_TRANSFER_HISTORY", + description: "Fetches the transfer history based on provided parameters", + template: MitoTemplates.getTransferHistoryTemplate, + examples: MitoExamples.getTransferHistoryExample, + similes: MitoSimiles.getTransferHistorySimiles, + functionName: "getTransferHistory", + validateContent: () => true, +}); + +// Staking Related Actions +export const GetStakingPoolsAction = createGenericAction({ + name: "GET_STAKING_POOLS", + description: "Retrieves information about staking pools", + template: MitoTemplates.getStakingPoolsTemplate, + examples: MitoExamples.getStakingPoolsExample, + similes: MitoSimiles.getStakingPoolsSimiles, + functionName: "getStakingPools", + validateContent: () => true, +}); + +export const GetStakingHistoryAction = createGenericAction({ + name: "GET_STAKING_HISTORY", + description: "Retrieves the staking history based on provided parameters", + template: MitoTemplates.getStakingHistoryTemplate, + examples: MitoExamples.getStakingHistoryExample, + similes: MitoSimiles.getStakingHistorySimiles, + functionName: "getStakingHistory", + validateContent: () => true, +}); + +export const GetStakingRewardsByAccountAction = createGenericAction({ + name: "GET_STAKING_REWARDS_BY_ACCOUNT", + description: "Retrieves staking rewards for a specific account", + template: MitoTemplates.getStakingRewardsByAccountTemplate, + examples: MitoExamples.getStakingRewardsByAccountExample, + similes: MitoSimiles.getStakingRewardsByAccountSimiles, + functionName: "getStakingRewardsByAccount", + validateContent: () => true, +}); + +// Mission Related Actions +export const GetMissionsAction = createGenericAction({ + name: "GET_MISSIONS", + description: "Fetches a list of missions based on provided parameters", + template: MitoTemplates.getMissionsTemplate, + examples: MitoExamples.getMissionsExample, + similes: MitoSimiles.getMissionsSimiles, + functionName: "getMissions", + validateContent: () => true, +}); + +export const GetMissionLeaderboardAction = createGenericAction({ + name: "GET_MISSION_LEADERBOARD", + description: + "Retrieves the leaderboard for missions based on the user address", + template: MitoTemplates.getMissionLeaderboardTemplate, + examples: MitoExamples.getMissionLeaderboardExample, + similes: MitoSimiles.getMissionLeaderboardSimiles, + functionName: "getMissionLeaderboard", + validateContent: () => true, +}); + +// IDO Related Actions +export const GetIDOAction = createGenericAction({ + name: "GET_IDO", + description: "Fetches details of a specific Initial DEX Offering (IDO)", + template: MitoTemplates.getIDOTemplate, + examples: MitoExamples.getIDOExample, + similes: MitoSimiles.getIDOSimiles, + functionName: "getIDO", + validateContent: () => true, +}); + +export const GetIDOsAction = createGenericAction({ + name: "GET_IDOS", + description: "Retrieves a list of all IDOs with optional filtering", + template: MitoTemplates.getIDOsTemplate, + examples: MitoExamples.getIDOsExample, + similes: MitoSimiles.getIDOsSimiles, + functionName: "getIDOs", + validateContent: () => true, +}); + +export const GetIDOSubscribersAction = createGenericAction({ + name: "GET_IDO_SUBSCRIBERS", + description: "Fetches subscribers for a specific IDO", + template: MitoTemplates.getIDOSubscribersTemplate, + examples: MitoExamples.getIDOSubscribersExample, + similes: MitoSimiles.getIDOSubscribersSimiles, + functionName: "getIDOSubscribers", + validateContent: () => true, +}); + +export const GetIDOSubscriptionAction = createGenericAction({ + name: "GET_IDO_SUBSCRIPTION", + description: "Retrieves the subscription details for a specific IDO", + template: MitoTemplates.getIDOSubscriptionTemplate, + examples: MitoExamples.getIDOSubscriptionExample, + similes: MitoSimiles.getIDOSubscriptionSimiles, + functionName: "getIDOSubscription", + validateContent: () => true, +}); + +export const GetIDOActivitiesAction = createGenericAction({ + name: "GET_IDO_ACTIVITIES", + description: "Retrieves activities related to a specific IDO", + template: MitoTemplates.getIDOActivitiesTemplate, + examples: MitoExamples.getIDOActivitiesExample, + similes: MitoSimiles.getIDOActivitiesSimiles, + functionName: "getIDOActivities", + validateContent: () => true, +}); + +export const GetIDOWhitelistAction = createGenericAction({ + name: "GET_IDO_WHITELIST", + description: "Fetches the whitelist for a specific IDO", + template: MitoTemplates.getIDOWhitelistTemplate, + examples: MitoExamples.getIDOWhitelistExample, + similes: MitoSimiles.getIDOWhitelistSimiles, + functionName: "getIDOWhitelist", + validateContent: () => true, +}); + +export const GetClaimReferencesAction = createGenericAction({ + name: "GET_CLAIM_REFERENCES", + description: "Retrieves claim references based on provided parameters", + template: MitoTemplates.getClaimReferencesTemplate, + examples: MitoExamples.getClaimReferencesExample, + similes: MitoSimiles.getClaimReferencesSimiles, + functionName: "getClaimReferences", + validateContent: () => true, +}); + +export const GetLaunchpadSubscribeAction = createGenericAction({ + name: "GET_LAUNCHPAD_SUBSCRIBE", + description: "Subscribes to a launchpad offering", + template: MitoTemplates.getLaunchpadSubscribeTemplate, + examples: MitoExamples.getLaunchpadSubscribeExample, + similes: MitoSimiles.getLaunchpadSubscribeSimiles, + functionName: "getLaunchpadSubscribe", + validateContent: () => true, +}); + +export const GetLaunchpadClaimAction = createGenericAction({ + name: "GET_LAUNCHPAD_CLAIM", + description: "Claims tokens from a launchpad offering", + template: MitoTemplates.getLaunchpadClaimTemplate, + examples: MitoExamples.getLaunchpadClaimExample, + similes: MitoSimiles.getLaunchpadClaimSimiles, + functionName: "getLaunchpadClaim", + validateContent: () => true, +}); + +// Vault Related Actions +export const GetSubscribeVaultAction = createGenericAction({ + name: "GET_SUBSCRIBE_VAULT", + description: "Subscribes to a specific vault", + template: MitoTemplates.getSubscribeVaultTemplate, + examples: MitoExamples.getSubscribeVaultExample, + similes: MitoSimiles.getSubscribeVaultSimiles, + functionName: "getSubscribeVault", + validateContent: () => true, +}); + +export const GetInstantiateCPMMVaultAction = createGenericAction({ + name: "GET_INSTANTIATE_CPMM_VAULT", + description: "Creates a new CPMM vault instance", + template: MitoTemplates.getInstantiateCPMMVaultTemplate, + examples: MitoExamples.getInstantiateCPMMVaultExample, + similes: MitoSimiles.getInstantiateCPMMVaultSimiles, + functionName: "getInstantiateCPMMVault", + validateContent: () => true, +}); + +export const GetRedeemFromVaultAction = createGenericAction({ + name: "GET_REDEEM_FROM_VAULT", + description: "Redeems tokens from a specific vault", + template: MitoTemplates.getRedeemFromVaultTemplate, + examples: MitoExamples.getRedeemFromVaultExample, + similes: MitoSimiles.getRedeemFromVaultSimiles, + functionName: "getRedeemFromVault", + validateContent: () => true, +}); + +export const GetStakeVaultLPAction = createGenericAction({ + name: "GET_STAKE_VAULT_LP", + description: "Stakes LP tokens in a vault", + template: MitoTemplates.getStakeVaultLPTemplate, + examples: MitoExamples.getStakeVaultLPExample, + similes: MitoSimiles.getStakeVaultLPSimiles, + functionName: "getStakeVaultLP", + validateContent: () => true, +}); + +export const GetUnstakeVaultLPAction = createGenericAction({ + name: "GET_UNSTAKE_VAULT_LP", + description: "Unstakes LP tokens from a vault", + template: MitoTemplates.getUnstakeVaultLPTemplate, + examples: MitoExamples.getUnstakeVaultLPExample, + similes: MitoSimiles.getUnstakeVaultLPSimiles, + functionName: "getUnstakeVaultLP", + validateContent: () => true, +}); + +export const GetClaimVaultRewardsAction = createGenericAction({ + name: "GET_CLAIM_VAULT_REWARDS", + description: "Claims rewards from a vault", + template: MitoTemplates.getClaimVaultRewardsTemplate, + examples: MitoExamples.getClaimVaultRewardsExample, + similes: MitoSimiles.getClaimVaultRewardsSimiles, + functionName: "getClaimVaultRewards", + validateContent: () => true, +}); + +// Export all actions as a group +export const MitoActions = [ + GetVaultAction, + GetVaultsAction, + GetVaultsByHolderAddressAction, + GetLpTokenPriceChartAction, + GetLPHoldersAction, + GetTVLChartAction, + GetHolderPortfolioAction, + GetLeaderboardAction, + GetLeaderboardEpochsAction, + GetTransferHistoryAction, + GetStakingPoolsAction, + GetStakingHistoryAction, + GetStakingRewardsByAccountAction, + GetMissionsAction, + GetMissionLeaderboardAction, + GetIDOAction, + GetIDOsAction, + GetIDOSubscribersAction, + GetIDOSubscriptionAction, + GetIDOActivitiesAction, + GetIDOWhitelistAction, + GetClaimReferencesAction, + GetLaunchpadSubscribeAction, + GetLaunchpadClaimAction, + GetSubscribeVaultAction, + GetInstantiateCPMMVaultAction, + GetRedeemFromVaultAction, + GetStakeVaultLPAction, + GetUnstakeVaultLPAction, + GetClaimVaultRewardsAction, +]; diff --git a/packages/plugin-injective/src/action/peggy.ts b/packages/plugin-injective/src/action/peggy.ts new file mode 100644 index 00000000000..96ea69e0419 --- /dev/null +++ b/packages/plugin-injective/src/action/peggy.ts @@ -0,0 +1,29 @@ +import { createGenericAction } from "./base"; +import * as PeggyTemplates from "@injective/template/peggy"; +import * as PeggyExamples from "@injective/examples/peggy"; +import * as PeggySimiles from "@injective/similes/peggy"; +// Query Actions +export const GetPeggyModuleParamsAction = createGenericAction({ + name: "GET_PEGGY_MODULE_PARAMS", + description: "Fetches the parameters of the Peggy module", + template: PeggyTemplates.getPeggyModuleParamsTemplate, + examples: PeggyExamples.getPeggyModuleParamsExample, + functionName: "getPeggyModuleParams", + similes: PeggySimiles.getPeggyModuleParamsSimiles, + validateContent: () => true, +}); + +// Message Actions +export const MsgSendToEthAction = createGenericAction({ + name: "MSG_SEND_TO_ETH", + description: + "Broadcasts a message to send tokens to an Ethereum address via IBC transfer", + template: PeggyTemplates.msgSendToEthTemplate, + examples: PeggyExamples.msgSendToEthExample, + functionName: "msgSendToEth", + similes: PeggySimiles.msgSendToEthSimiles, + validateContent: () => true, +}); + +// Export all actions as a group +export const PeggyActions = [GetPeggyModuleParamsAction, MsgSendToEthAction]; diff --git a/packages/plugin-injective/src/action/permissions.ts b/packages/plugin-injective/src/action/permissions.ts new file mode 100644 index 00000000000..e87c8a8ed75 --- /dev/null +++ b/packages/plugin-injective/src/action/permissions.ts @@ -0,0 +1,74 @@ +import { createGenericAction } from "./base"; +import * as PermissionsTemplates from "@injective/template/permissions"; +import * as PermissionsExamples from "@injective/examples/permissions"; +import * as PermissionsSimiles from "@injective/similes/permissions"; +export const GetAddressesByRoleAction = createGenericAction({ + name: "GET_ADDRESSES_BY_ROLE", + description: "Fetches addresses associated with a specific role", + template: PermissionsTemplates.getAddressesByRoleTemplate, + examples: PermissionsExamples.getAddressesByRoleExample, + similes: PermissionsSimiles.getAddressesByRoleSimiles, + functionName: "getAddressesByRole", + validateContent: () => true, +}); + +export const GetAddressRolesAction = createGenericAction({ + name: "GET_ADDRESS_ROLES", + description: "Retrieves roles associated with a specific address", + template: PermissionsTemplates.getAddressRolesTemplate, + examples: PermissionsExamples.getAddressRolesExample, + similes: PermissionsSimiles.getAddressRolesSimiles, + functionName: "getAddressRoles", + validateContent: () => true, +}); + +export const GetAllNamespacesAction = createGenericAction({ + name: "GET_ALL_NAMESPACES", + description: "Retrieves all namespaces within the permissions module", + template: PermissionsTemplates.getAllNamespacesTemplate, + examples: PermissionsExamples.getAllNamespacesExample, + similes: PermissionsSimiles.getAllNamespacesSimiles, + functionName: "getAllNamespaces", + validateContent: () => true, +}); + +export const GetPermissionsModuleParamsAction = createGenericAction({ + name: "GET_PERMISSIONS_MODULE_PARAMS", + description: "Fetches the parameters of the Permissions module", + template: PermissionsTemplates.getPermissionsModuleParamsTemplate, + examples: PermissionsExamples.getPermissionsModuleParamsExample, + similes: PermissionsSimiles.getPermissionsModuleParamsSimiles, + functionName: "getPermissionsModuleParams", + validateContent: () => true, +}); + +export const GetNamespaceByDenomAction = createGenericAction({ + name: "GET_NAMESPACE_BY_DENOM", + description: + "Retrieves the namespace associated with a specific denomination", + template: PermissionsTemplates.getNamespaceByDenomTemplate, + examples: PermissionsExamples.getNamespaceByDenomExample, + similes: PermissionsSimiles.getNamespaceByDenomSimiles, + functionName: "getNamespaceByDenom", + validateContent: () => true, +}); + +export const GetVouchersForAddressAction = createGenericAction({ + name: "GET_VOUCHERS_FOR_ADDRESS", + description: "Retrieves vouchers associated with a specific address", + template: PermissionsTemplates.getVouchersForAddressTemplate, + examples: PermissionsExamples.getVouchersForAddressExample, + similes: PermissionsSimiles.getVouchersForAddressSimiles, + functionName: "getVouchersForAddress", + validateContent: () => true, +}); + +// Export all actions as a group +export const PermissionsActions = [ + GetAddressesByRoleAction, + GetAddressRolesAction, + GetAllNamespacesAction, + GetPermissionsModuleParamsAction, + GetNamespaceByDenomAction, + GetVouchersForAddressAction, +]; diff --git a/packages/plugin-injective/src/action/staking.ts b/packages/plugin-injective/src/action/staking.ts new file mode 100644 index 00000000000..45288e26fa4 --- /dev/null +++ b/packages/plugin-injective/src/action/staking.ts @@ -0,0 +1,280 @@ +import { createGenericAction } from "./base"; +import * as StakingTemplates from "@injective/template/staking"; +import * as StakingExamples from "@injective/examples/staking"; +import * as StakingSimiles from "@injective/similes/staking"; +// Module and Pool Query Actions +export const GetStakingModuleParamsAction = createGenericAction({ + name: "GET_STAKING_MODULE_PARAMS", + description: "Fetches the staking module parameters", + template: StakingTemplates.getStakingModuleParamsTemplate, + examples: StakingExamples.getStakingModuleParamsExample, + similes: StakingSimiles.getStakingModuleParamsSimiles, + functionName: "getStakingModuleParams", + validateContent: () => true, +}); + +export const GetPoolAction = createGenericAction({ + name: "GET_POOL", + description: "Fetches the staking pool information", + template: StakingTemplates.getPoolTemplate, + examples: StakingExamples.getPoolExample, + similes: StakingSimiles.getPoolSimiles, + functionName: "getPool", + validateContent: () => true, +}); + +// Validator Query Actions +export const GetValidatorsAction = createGenericAction({ + name: "GET_VALIDATORS", + description: "Fetches a list of validators with optional pagination", + template: StakingTemplates.getValidatorsTemplate, + examples: StakingExamples.getValidatorsExample, + similes: StakingSimiles.getValidatorSimiles, + functionName: "getValidators", + validateContent: () => true, +}); + +export const GetValidatorAction = createGenericAction({ + name: "GET_VALIDATOR", + description: "Fetches a specific validator by address", + template: StakingTemplates.getValidatorTemplate, + examples: StakingExamples.getValidatorExample, + similes: StakingSimiles.getValidatorSimiles, + functionName: "getValidator", + validateContent: () => true, +}); + +// Delegation Query Actions +export const GetValidatorDelegationsAction = createGenericAction({ + name: "GET_VALIDATOR_DELEGATIONS", + description: "Fetches delegations for a specific validator", + template: StakingTemplates.getValidatorDelegationsTemplate, + examples: StakingExamples.getValidatorDelegationsExample, + similes: StakingSimiles.getValidatorDelegationsSimiles, + functionName: "getValidatorDelegations", + validateContent: () => true, +}); + +export const GetValidatorDelegationsNoThrowAction = createGenericAction({ + name: "GET_VALIDATOR_DELEGATIONS_NO_THROW", + description: + "Fetches delegations for a specific validator without throwing an error", + template: StakingTemplates.getValidatorDelegationsNoThrowTemplate, + examples: StakingExamples.getValidatorDelegationsNoThrowExample, + similes: StakingSimiles.getValidatorDelegationsNoThrowSimiles, + functionName: "getValidatorDelegationsNoThrow", + validateContent: () => true, +}); + +export const GetValidatorUnbondingDelegationsAction = createGenericAction({ + name: "GET_VALIDATOR_UNBONDING_DELEGATIONS", + description: "Fetches unbonding delegations for a specific validator", + template: StakingTemplates.getValidatorUnbondingDelegationsTemplate, + examples: StakingExamples.getValidatorUnbondingDelegationsExample, + similes: StakingSimiles.getValidatorUnbondingDelegationsSimiles, + functionName: "getValidatorUnbondingDelegations", + validateContent: () => true, +}); + +export const GetValidatorUnbondingDelegationsNoThrowAction = + createGenericAction({ + name: "GET_VALIDATOR_UNBONDING_DELEGATIONS_NO_THROW", + description: + "Fetches unbonding delegations for a specific validator without throwing an error", + template: + StakingTemplates.getValidatorUnbondingDelegationsNoThrowTemplate, + examples: + StakingExamples.getValidatorUnbondingDelegationsNoThrowExample, + similes: StakingSimiles.getValidatorDelegationsNoThrowSimiles, + functionName: "getValidatorUnbondingDelegationsNoThrow", + validateContent: () => true, + }); + +export const GetDelegationAction = createGenericAction({ + name: "GET_DELEGATION", + description: "Fetches a specific delegation", + template: StakingTemplates.getDelegationTemplate, + examples: StakingExamples.getDelegationExample, + similes: StakingSimiles.getDelegationSimiles, + functionName: "getDelegation", + validateContent: () => true, +}); + +export const GetDelegationsAction = createGenericAction({ + name: "GET_DELEGATIONS", + description: "Fetches all delegations for a delegator", + template: StakingTemplates.getDelegationsTemplate, + examples: StakingExamples.getDelegationsExample, + similes: StakingSimiles.getDelegationsSimiles, + functionName: "getDelegations", + validateContent: () => true, +}); + +export const GetDelegationsNoThrowAction = createGenericAction({ + name: "GET_DELEGATIONS_NO_THROW", + description: + "Fetches all delegations for a delegator without throwing an error", + template: StakingTemplates.getDelegationsNoThrowTemplate, + examples: StakingExamples.getDelegationsNoThrowExample, + similes: StakingSimiles.getDelegationsNoThrowSimiles, + functionName: "getDelegationsNoThrow", + validateContent: () => true, +}); + +export const GetDelegatorsAction = createGenericAction({ + name: "GET_DELEGATORS", + description: "Fetches all delegators for a validator", + template: StakingTemplates.getDelegatorsTemplate, + examples: StakingExamples.getDelegatorsExample, + similes: StakingSimiles.getDelegatorsSimiles, + functionName: "getDelegators", + validateContent: () => true, +}); + +export const GetDelegatorsNoThrowAction = createGenericAction({ + name: "GET_DELEGATORS_NO_THROW", + description: + "Fetches all delegators for a validator without throwing an error", + template: StakingTemplates.getDelegatorsNoThrowTemplate, + examples: StakingExamples.getDelegatorsNoThrowExample, + similes: StakingSimiles.getDelegatorsNoThrowSimiles, + functionName: "getDelegatorsNoThrow", + validateContent: () => true, +}); + +export const GetUnbondingDelegationsAction = createGenericAction({ + name: "GET_UNBONDING_DELEGATIONS", + description: "Fetches all unbonding delegations for a delegator", + template: StakingTemplates.getUnbondingDelegationsTemplate, + examples: StakingExamples.getUnbondingDelegationsExample, + similes: StakingSimiles.getUnbondingDelegationsSimiles, + functionName: "getUnbondingDelegations", + validateContent: () => true, +}); + +export const GetUnbondingDelegationsNoThrowAction = createGenericAction({ + name: "GET_UNBONDING_DELEGATIONS_NO_THROW", + description: + "Fetches all unbonding delegations for a delegator without throwing an error", + template: StakingTemplates.getUnbondingDelegationsNoThrowTemplate, + examples: StakingExamples.getUnbondingDelegationsNoThrowExample, + similes: StakingSimiles.getUnbondingDelegationsNoThrowSimiles, + functionName: "getUnbondingDelegationsNoThrow", + validateContent: () => true, +}); + +export const GetReDelegationsAction = createGenericAction({ + name: "GET_REDELEGATIONS", + description: "Fetches all redelegations for a delegator", + template: StakingTemplates.getReDelegationsTemplate, + examples: StakingExamples.getReDelegationsExample, + similes: StakingSimiles.getReDelegationsSimiles, + functionName: "getReDelegations", + validateContent: () => true, +}); + +export const GetReDelegationsNoThrowAction = createGenericAction({ + name: "GET_REDELEGATIONS_NO_THROW", + description: + "Fetches all redelegations for a delegator without throwing an error", + template: StakingTemplates.getReDelegationsNoThrowTemplate, + examples: StakingExamples.getReDelegationsNoThrowExample, + similes: StakingSimiles.getReDelegationsNoThrowSimiles, + functionName: "getReDelegationsNoThrow", + validateContent: () => true, +}); + +// Message Actions +export const MsgBeginRedelegateAction = createGenericAction({ + name: "MSG_BEGIN_REDELEGATE", + description: "Broadcasts a message to begin redelegating tokens", + template: StakingTemplates.msgBeginRedelegateTemplate, + examples: StakingExamples.msgBeginRedelegateExample, + similes: StakingSimiles.msgBeginRedelegateSimiles, + functionName: "msgBeginRedelegate", + validateContent: () => true, +}); + +export const MsgDelegateAction = createGenericAction({ + name: "MSG_DELEGATE", + description: "Broadcasts a message to delegate tokens to a validator", + template: StakingTemplates.msgDelegateTemplate, + examples: StakingExamples.msgDelegateExample, + similes: StakingSimiles.msgDelegateSimiles, + functionName: "msgDelegate", + validateContent: () => true, +}); + +export const MsgUndelegateAction = createGenericAction({ + name: "MSG_UNDELEGATE", + description: "Broadcasts a message to undelegate tokens from a validator", + template: StakingTemplates.msgUndelegateTemplate, + examples: StakingExamples.msgUndelegateExample, + similes: StakingSimiles.msgUndelegateSimiles, + functionName: "msgUndelegate", + validateContent: () => true, +}); + +export const MsgCreateValidatorAction = createGenericAction({ + name: "MSG_CREATE_VALIDATOR", + description: "Broadcasts a message to create a new validator", + template: StakingTemplates.msgCreateValidatorTemplate, + examples: StakingExamples.msgCreateValidatorExample, + similes: StakingSimiles.msgCreateValidatorSimiles, + functionName: "msgCreateValidator", + validateContent: () => true, +}); + +export const MsgEditValidatorAction = createGenericAction({ + name: "MSG_EDIT_VALIDATOR", + description: "Broadcasts a message to edit an existing validator", + template: StakingTemplates.msgEditValidatorTemplate, + examples: StakingExamples.msgEditValidatorExample, + similes: StakingSimiles.msgEditValidatorSimiles, + functionName: "msgEditValidator", + validateContent: () => true, +}); + +export const MsgCancelUnbondingDelegationAction = createGenericAction({ + name: "MSG_CANCEL_UNBONDING_DELEGATION", + description: "Broadcasts a message to cancel an unbonding delegation", + template: StakingTemplates.msgCancelUnbondingDelegationTemplate, + examples: StakingExamples.msgCancelUnbondingDelegationExample, + similes: StakingSimiles.msgCancelUnbondingDelegationSimiles, + functionName: "msgCancelUnbondingDelegation", + validateContent: () => true, +}); + +// Export all actions as a group +export const StakingActions = [ + // Module and Pool Actions + GetStakingModuleParamsAction, + GetPoolAction, + + // Validator Actions + GetValidatorsAction, + GetValidatorAction, + + // Delegation Query Actions + GetValidatorDelegationsAction, + GetValidatorDelegationsNoThrowAction, + GetValidatorUnbondingDelegationsAction, + GetValidatorUnbondingDelegationsNoThrowAction, + GetDelegationAction, + GetDelegationsAction, + GetDelegationsNoThrowAction, + GetDelegatorsAction, + GetDelegatorsNoThrowAction, + GetUnbondingDelegationsAction, + GetUnbondingDelegationsNoThrowAction, + GetReDelegationsAction, + GetReDelegationsNoThrowAction, + + // Message Actions + MsgBeginRedelegateAction, + MsgDelegateAction, + MsgUndelegateAction, + MsgCreateValidatorAction, + MsgEditValidatorAction, + MsgCancelUnbondingDelegationAction, +]; diff --git a/packages/plugin-injective/src/action/token-factory.ts b/packages/plugin-injective/src/action/token-factory.ts new file mode 100644 index 00000000000..c92a31a6f06 --- /dev/null +++ b/packages/plugin-injective/src/action/token-factory.ts @@ -0,0 +1,111 @@ +import { createGenericAction } from "./base"; +import * as TokenFactoryTemplates from "@injective/template/token-factory"; +import * as TokenFactoryExamples from "@injective/examples/token-factory"; +import * as TokenFactorySimiles from "@injective/similes/token-factory"; +// Query Actions +export const GetDenomsFromCreatorAction = createGenericAction({ + name: "GET_DENOMS_FROM_CREATOR", + description: "Fetches all denominations created by a specific creator", + template: TokenFactoryTemplates.getDenomsFromCreatorTemplate, + examples: TokenFactoryExamples.getDenomsFromCreatorExample, + similes: TokenFactorySimiles.getDenomsFromCreatorSimiles, + functionName: "getDenomsFromCreator", + validateContent: () => true, +}); + +export const GetDenomAuthorityMetadataAction = createGenericAction({ + name: "GET_DENOM_AUTHORITY_METADATA", + description: "Fetches the authority metadata for a specific denomination", + template: TokenFactoryTemplates.getDenomAuthorityMetadataTemplate, + examples: TokenFactoryExamples.getDenomAuthorityMetadataExample, + similes: TokenFactorySimiles.getDenomAuthorityMetadataSimiles, + functionName: "getDenomAuthorityMetadata", + validateContent: () => true, +}); + +export const GetTokenFactoryModuleParamsAction = createGenericAction({ + name: "GET_TOKEN_FACTORY_MODULE_PARAMS", + description: "Fetches the parameters of the Token Factory module", + template: TokenFactoryTemplates.getTokenFactoryModuleParamsTemplate, + examples: TokenFactoryExamples.getTokenFactoryModuleParamsExample, + similes: TokenFactorySimiles.getTokenFactoryModuleParamsSimiles, + functionName: "getTokenFactoryModuleParams", + validateContent: () => true, +}); + +export const GetTokenFactoryModuleStateAction = createGenericAction({ + name: "GET_TOKEN_FACTORY_MODULE_STATE", + description: "Fetches the current state of the Token Factory module", + template: TokenFactoryTemplates.getTokenFactoryModuleStateTemplate, + examples: TokenFactoryExamples.getTokenFactoryModuleStateExample, + similes: TokenFactorySimiles.getTokenFactoryModuleStateSimiles, + functionName: "getTokenFactoryModuleState", + validateContent: () => true, +}); + +// Message Actions +export const MsgBurnAction = createGenericAction({ + name: "MSG_BURN", + description: "Broadcasts a message to burn tokens", + template: TokenFactoryTemplates.msgBurnTemplate, + examples: TokenFactoryExamples.msgBurnExample, + similes: TokenFactorySimiles.msgBurnSimiles, + functionName: "msgBurn", + validateContent: () => true, +}); + +export const MsgChangeAdminAction = createGenericAction({ + name: "MSG_CHANGE_ADMIN", + description: "Broadcasts a message to change the admin of a denomination", + template: TokenFactoryTemplates.msgChangeAdminTemplate, + examples: TokenFactoryExamples.msgChangeAdminExample, + similes: TokenFactorySimiles.msgChangeAdminSimiles, + functionName: "msgChangeAdmin", + validateContent: () => true, +}); + +export const MsgCreateDenomAction = createGenericAction({ + name: "MSG_CREATE_DENOM", + description: "Broadcasts a message to create a new denomination", + template: TokenFactoryTemplates.msgCreateDenomTemplate, + examples: TokenFactoryExamples.msgCreateDenomExample, + similes: TokenFactorySimiles.msgCreateDenomSimiles, + functionName: "msgCreateDenom", + validateContent: () => true, +}); + +export const MsgMintAction = createGenericAction({ + name: "MSG_MINT", + description: "Broadcasts a message to mint new tokens", + template: TokenFactoryTemplates.msgMintTemplate, + examples: TokenFactoryExamples.msgMintExample, + similes: TokenFactorySimiles.msgMintSimiles, + functionName: "msgMint", + validateContent: () => true, +}); + +export const MsgSetDenomMetadataAction = createGenericAction({ + name: "MSG_SET_DENOM_METADATA", + description: "Broadcasts a message to set metadata for a denomination", + template: TokenFactoryTemplates.msgSetDenomMetadataTemplate, + examples: TokenFactoryExamples.msgSetDenomMetadataExample, + similes: TokenFactorySimiles.msgSetDenomMetadataSimiles, + functionName: "msgSetDenomMetadata", + validateContent: () => true, +}); + +// Export all actions as a group +export const TokenFactoryActions = [ + // Query Actions + GetDenomsFromCreatorAction, + GetDenomAuthorityMetadataAction, + GetTokenFactoryModuleParamsAction, + GetTokenFactoryModuleStateAction, + + // Message Actions + MsgBurnAction, + MsgChangeAdminAction, + MsgCreateDenomAction, + MsgMintAction, + MsgSetDenomMetadataAction, +]; diff --git a/packages/plugin-injective/src/action/wasm.ts b/packages/plugin-injective/src/action/wasm.ts new file mode 100644 index 00000000000..06908519d43 --- /dev/null +++ b/packages/plugin-injective/src/action/wasm.ts @@ -0,0 +1,219 @@ +import { createGenericAction } from "./base"; +import * as WasmTemplates from "@injective/template/wasm"; +import * as WasmExamples from "@injective/examples/wasm"; +import * as WasmSimiles from "@injective/similes/wasm"; +// Contract Query Actions +export const GetContractAccountsBalanceAction = createGenericAction({ + name: "GET_CONTRACT_ACCOUNTS_BALANCE", + description: "Fetches the balance of contract accounts", + template: WasmTemplates.getContractAccountsBalanceTemplate, + examples: WasmExamples.getContractAccountsBalanceExample, + similes: WasmSimiles.getContractAccountsBalanceSimiles, + functionName: "getContractAccountsBalance", + validateContent: () => true, +}); + +export const GetContractStateAction = createGenericAction({ + name: "GET_CONTRACT_STATE", + description: "Fetches the state of a specific contract", + template: WasmTemplates.getContractStateTemplate, + examples: WasmExamples.getContractStateExample, + similes: WasmSimiles.getContractStateSimiles, + functionName: "getContractState", + validateContent: () => true, +}); + +export const GetContractInfoAction = createGenericAction({ + name: "GET_CONTRACT_INFO", + description: "Fetches information about a specific contract", + template: WasmTemplates.getContractInfoTemplate, + examples: WasmExamples.getContractInfoExample, + similes: WasmSimiles.getContractInfoSimiles, + functionName: "getContractInfo", + validateContent: () => true, +}); + +export const GetContractHistoryAction = createGenericAction({ + name: "GET_CONTRACT_HISTORY", + description: "Fetches the history of a specific contract", + template: WasmTemplates.getContractHistoryTemplate, + examples: WasmExamples.getContractHistoryExample, + similes: WasmSimiles.getContractHistorySimiles, + functionName: "getContractHistory", + validateContent: () => true, +}); + +export const GetSmartContractStateAction = createGenericAction({ + name: "GET_SMART_CONTRACT_STATE", + description: "Fetches the smart contract state based on a query", + template: WasmTemplates.getSmartContractStateTemplate, + examples: WasmExamples.getSmartContractStateExample, + similes: WasmSimiles.getSmartContractStateSimiles, + functionName: "getSmartContractState", + validateContent: () => true, +}); + +export const GetRawContractStateAction = createGenericAction({ + name: "GET_RAW_CONTRACT_STATE", + description: + "Fetches the raw state of a specific contract based on a query", + template: WasmTemplates.getRawContractStateTemplate, + examples: WasmExamples.getRawContractStateExample, + similes: WasmSimiles.getRawContractStateSimiles, + functionName: "getRawContractState", + validateContent: () => true, +}); + +// Code Query Actions +export const GetContractCodesAction = createGenericAction({ + name: "GET_CONTRACT_CODES", + description: "Fetches all contract codes with optional pagination", + template: WasmTemplates.getContractCodesTemplate, + examples: WasmExamples.getContractCodesExample, + similes: WasmSimiles.getContractCodesSimiles, + functionName: "getContractCodes", + validateContent: () => true, +}); + +export const GetContractCodeAction = createGenericAction({ + name: "GET_CONTRACT_CODE", + description: "Fetches a specific contract code by its ID", + template: WasmTemplates.getContractCodeTemplate, + examples: WasmExamples.getContractCodeExample, + similes: WasmSimiles.getContractCodeSimiles, + functionName: "getContractCode", + validateContent: () => true, +}); + +export const GetContractCodeContractsAction = createGenericAction({ + name: "GET_CONTRACT_CODE_CONTRACTS", + description: "Fetches contracts associated with a specific contract code", + template: WasmTemplates.getContractCodeContractsTemplate, + examples: WasmExamples.getContractCodeContractsExample, + similes: WasmSimiles.getContractCodeContractsSimiles, + functionName: "getContractCodeContracts", + validateContent: () => true, +}); + +// Message Actions +export const MsgStoreCodeAction = createGenericAction({ + name: "MSG_STORE_CODE", + description: "Broadcasts a message to store new contract code", + template: WasmTemplates.msgStoreCodeTemplate, + examples: WasmExamples.msgStoreCodeExample, + similes: WasmSimiles.msgStoreCodeSimiles, + functionName: "msgStoreCode", + validateContent: () => true, +}); + +export const MsgUpdateAdminAction = createGenericAction({ + name: "MSG_UPDATE_ADMIN", + description: "Broadcasts a message to update the admin of a contract", + template: WasmTemplates.msgUpdateAdminTemplate, + examples: WasmExamples.msgUpdateAdminExample, + similes: WasmSimiles.msgUpdateAdminSimiles, + functionName: "msgUpdateAdmin", + validateContent: () => true, +}); + +export const MsgExecuteContractAction = createGenericAction({ + name: "MSG_EXECUTE_CONTRACT", + description: "Broadcasts a message to execute a contract", + template: WasmTemplates.msgExecuteContractTemplate, + examples: WasmExamples.msgExecuteContractExample, + similes: WasmSimiles.msgExecuteContractSimiles, + functionName: "msgExecuteContract", + validateContent: () => true, +}); + +export const MsgMigrateContractAction = createGenericAction({ + name: "MSG_MIGRATE_CONTRACT", + description: + "Broadcasts a message to migrate a contract to a new code version", + template: WasmTemplates.msgMigrateContractTemplate, + examples: WasmExamples.msgMigrateContractExample, + similes: WasmSimiles.msgMigrateContractSimiles, + functionName: "msgMigrateContract", + validateContent: () => true, +}); + +export const MsgInstantiateContractAction = createGenericAction({ + name: "MSG_INSTANTIATE_CONTRACT", + description: "Broadcasts a message to instantiate a new contract", + template: WasmTemplates.msgInstantiateContractTemplate, + examples: WasmExamples.msgInstantiateContractExample, + similes: WasmSimiles.msgInstantiateContractSimiles, + functionName: "msgInstantiateContract", + validateContent: () => true, +}); + +export const MsgExecuteContractCompatAction = createGenericAction({ + name: "MSG_EXECUTE_CONTRACT_COMPAT", + description: + "Broadcasts a message to execute a contract using compatibility mode", + template: WasmTemplates.msgExecuteContractCompatTemplate, + examples: WasmExamples.msgExecuteContractCompatExample, + similes: WasmSimiles.msgExecuteContractCompatSimiles, + functionName: "msgExecuteContractCompat", + validateContent: () => true, +}); + +export const MsgPrivilegedExecuteContractAction = createGenericAction({ + name: "MSG_PRIVILEGED_EXECUTE_CONTRACT", + description: "Broadcasts a privileged message to execute a contract", + template: WasmTemplates.msgPrivilegedExecuteContractTemplate, + examples: WasmExamples.msgPrivilegedExecuteContractExample, + similes: WasmSimiles.msgPrivilegedExecuteContractSimiles, + functionName: "msgPrivilegedExecuteContract", + validateContent: () => true, +}); + +// WasmX Query Actions +export const GetWasmxModuleParamsAction = createGenericAction({ + name: "GET_WASMX_MODULE_PARAMS", + description: "Fetches the parameters of the WasmX module", + template: WasmTemplates.getWasmxModuleParamsTemplate, + examples: WasmExamples.getWasmxModuleParamsExample, + similes: WasmSimiles.getWasmxModuleParamsSimiles, + functionName: "getWasmxModuleParams", + validateContent: () => true, +}); + +export const GetWasmxModuleStateAction = createGenericAction({ + name: "GET_WASMX_MODULE_STATE", + description: "Fetches the current state of the WasmX module", + template: WasmTemplates.getWasmxModuleStateTemplate, + examples: WasmExamples.getWasmxModuleStateExample, + similes: WasmSimiles.getWasmxModuleStateSimiles, + functionName: "getWasmxModuleState", + validateContent: () => true, +}); + +// Export all actions as a group +export const WasmActions = [ + // Contract Query Actions + GetContractAccountsBalanceAction, + GetContractStateAction, + GetContractInfoAction, + GetContractHistoryAction, + GetSmartContractStateAction, + GetRawContractStateAction, + + // Code Query Actions + GetContractCodesAction, + GetContractCodeAction, + GetContractCodeContractsAction, + + // Message Actions + MsgStoreCodeAction, + MsgUpdateAdminAction, + MsgExecuteContractAction, + MsgMigrateContractAction, + MsgInstantiateContractAction, + MsgExecuteContractCompatAction, + MsgPrivilegedExecuteContractAction, + + // WasmX Query Actions + GetWasmxModuleParamsAction, + GetWasmxModuleStateAction, +]; diff --git a/packages/plugin-injective/src/index.ts b/packages/plugin-injective/src/index.ts new file mode 100644 index 00000000000..c0d5e1e49dd --- /dev/null +++ b/packages/plugin-injective/src/index.ts @@ -0,0 +1,11 @@ +import InjectiveActions from "./action"; +import { Plugin } from "@elizaos/core"; +export const injectivePlugin: Plugin = { + name: "injective", + description: "A plugin for interacting with the Injective blockchain", + actions: InjectiveActions, + evaluators: [], + providers: [], //TODO: Integrate with injective-trader to run MM and Taking Strats +}; + +export default injectivePlugin; diff --git a/packages/plugin-injective/tsconfig.json b/packages/plugin-injective/tsconfig.json new file mode 100644 index 00000000000..5d351328304 --- /dev/null +++ b/packages/plugin-injective/tsconfig.json @@ -0,0 +1,24 @@ +{ + "extends": "../core/tsconfig.json", + "compilerOptions": { + "outDir": "dist", + "rootDir": ".", + "rootDirs": [ + "src", + "injective-sdk-client-ts" + ], + "baseUrl": ".", + "paths": { + "@injective/*": [ + "injective-sdk-client-ts/src/*" + ] + }, + "types": [ + "node" + ] + }, + "include": [ + "src/**/*.ts", + "injective-sdk-client-ts/**/*.ts", + ] +} \ No newline at end of file diff --git a/packages/plugin-injective/tsup.config.ts b/packages/plugin-injective/tsup.config.ts new file mode 100644 index 00000000000..78773191659 --- /dev/null +++ b/packages/plugin-injective/tsup.config.ts @@ -0,0 +1,50 @@ +import { defineConfig } from 'tsup'; +import { builtinModules } from 'module'; +import pkg from './package.json'; + +export default defineConfig({ + entry: ['src/index.ts'], + format: ['cjs', 'esm'], + dts: true, + sourcemap: true, + clean: true, + splitting: false, + minify: false, + platform: 'node', + target: 'node23', + + // Bundle problematic packages + noExternal: [ + 'form-data', + 'combined-stream', + 'delayed-stream', + 'mime-types', + 'mime-db', + 'asynckit', + 'util' + ], + + external: [ + ...builtinModules.filter(mod => mod !== 'util'), + ...Object.keys(pkg.dependencies || {}) + .filter(dep => !['form-data', 'combined-stream', 'delayed-stream', + 'mime-types', 'mime-db', 'asynckit'].includes(dep)) + ], + + esbuildOptions: (options) => { + options.mainFields = ['module', 'main']; + options.banner = { + js: ` + import { createRequire } from 'module'; + import { fileURLToPath } from 'url'; + import { dirname } from 'path'; + const require = createRequire(import.meta.url); + const __filename = fileURLToPath(import.meta.url); + const __dirname = dirname(__filename); + ` + }; + options.define = { + 'process.env.NODE_ENV': '"production"' + }; + } +}); \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 92044a8bcf4..7f80a26b77c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -21,6 +21,9 @@ importers: '@deepgram/sdk': specifier: ^3.9.0 version: 3.9.0(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@6.0.5) + '@injectivelabs/sdk-ts': + specifier: ^1.14.33 + version: 1.14.33(@types/react@19.0.7)(bufferutil@4.0.9)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(utf-8-validate@6.0.5) '@vitest/eslint-plugin': specifier: 1.0.1 version: 1.0.1(@typescript-eslint/utils@8.20.0(eslint@9.16.0(jiti@2.4.2))(typescript@5.6.3))(eslint@9.16.0(jiti@2.4.2))(typescript@5.6.3)(vitest@2.1.5(@types/node@22.10.7)(jsdom@25.0.1(bufferutil@4.0.9)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@6.0.5))(terser@5.37.0)) @@ -81,7 +84,7 @@ importers: version: 9.1.7 jest: specifier: ^29.7.0 - version: 29.7.0(@types/node@22.10.7)(babel-plugin-macros@3.1.0) + version: 29.7.0(@types/node@22.10.7)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@22.10.7)(typescript@5.7.3)) lerna: specifier: 8.1.5 version: 8.1.5(@swc/core@1.10.7(@swc/helpers@0.5.15))(babel-plugin-macros@3.1.0)(encoding@0.1.13) @@ -262,6 +265,9 @@ importers: '@elizaos/plugin-image-generation': specifier: workspace:* version: link:../packages/plugin-image-generation + '@elizaos/plugin-injective': + specifier: workspace:* + version: link:../packages/plugin-injective '@elizaos/plugin-intiface': specifier: workspace:* version: link:../packages/plugin-intiface @@ -376,13 +382,13 @@ importers: version: 29.5.14 jest: specifier: ^29.7.0 - version: 29.7.0(@types/node@20.17.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@20.17.9)(typescript@5.7.3)) + version: 29.7.0(@types/node@22.10.7)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@22.10.7)(typescript@5.7.3)) ts-jest: specifier: ^29.2.5 - version: 29.2.5(@babel/core@7.26.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.0))(esbuild@0.24.2)(jest@29.7.0(@types/node@20.17.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@20.17.9)(typescript@5.7.3)))(typescript@5.7.3) + version: 29.2.5(@babel/core@7.26.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.0))(esbuild@0.24.2)(jest@29.7.0(@types/node@22.10.7)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@22.10.7)(typescript@5.7.3)))(typescript@5.7.3) ts-node: specifier: 10.9.2 - version: 10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@20.17.9)(typescript@5.7.3) + version: 10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@22.10.7)(typescript@5.7.3) tsup: specifier: 8.3.5 version: 8.3.5(@swc/core@1.10.7(@swc/helpers@0.5.15))(jiti@2.4.2)(postcss@8.5.1)(tsx@4.19.2)(typescript@5.7.3)(yaml@2.7.0) @@ -879,6 +885,9 @@ importers: tsup: specifier: 8.3.5 version: 8.3.5(@swc/core@1.10.7(@swc/helpers@0.5.15))(jiti@2.4.2)(postcss@8.5.1)(tsx@4.19.2)(typescript@5.7.3)(yaml@2.7.0) + vitest: + specifier: ^1.2.1 + version: 1.2.1(@types/node@22.10.7)(jsdom@25.0.1(bufferutil@4.0.9)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@6.0.5))(terser@5.37.0) packages/client-instagram: dependencies: @@ -912,7 +921,7 @@ importers: version: link:../core '@lens-protocol/client': specifier: 2.2.0 - version: 2.2.0(@jest/globals@29.7.0)(@lens-protocol/metadata@1.2.0(zod@3.23.8))(bufferutil@4.0.9)(encoding@0.1.13)(ethers@6.13.4(bufferutil@4.0.9)(utf-8-validate@5.0.10))(utf-8-validate@5.0.10) + version: 2.2.0(@jest/globals@29.7.0)(@lens-protocol/metadata@1.2.0(zod@3.23.8))(@types/react@19.0.7)(bufferutil@4.0.9)(encoding@0.1.13)(ethers@6.13.4(bufferutil@4.0.9)(utf-8-validate@5.0.10))(react@19.0.0)(utf-8-validate@5.0.10) '@lens-protocol/metadata': specifier: 1.2.0 version: 1.2.0(zod@3.23.8) @@ -960,30 +969,21 @@ importers: '@types/fluent-ffmpeg': specifier: ^2.1.24 version: 2.1.27 - '@types/jest': - specifier: ^29.5.0 - version: 29.5.14 '@types/node': specifier: ^18.15.11 version: 18.19.71 - jest: - specifier: ^29.5.0 - version: 29.7.0(@types/node@18.19.71)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@18.19.71)(typescript@5.6.3)) rimraf: specifier: ^5.0.0 version: 5.0.10 - ts-jest: - specifier: ^29.1.0 - version: 29.2.5(@babel/core@7.26.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.0))(jest@29.7.0(@types/node@18.19.71)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@18.19.71)(typescript@5.6.3)))(typescript@5.6.3) - ts-node: - specifier: ^10.9.1 - version: 10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@18.19.71)(typescript@5.6.3) tsup: - specifier: ^8.3.5 - version: 8.3.5(@swc/core@1.10.7(@swc/helpers@0.5.15))(jiti@2.4.2)(postcss@8.5.1)(tsx@4.19.2)(typescript@5.6.3)(yaml@2.7.0) + specifier: ^6.7.0 + version: 6.7.0(@swc/core@1.10.7(@swc/helpers@0.5.15))(postcss@8.5.1)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@18.19.71)(typescript@5.6.3))(typescript@5.6.3) typescript: - specifier: ^5.0.0 + specifier: ^5.0.3 version: 5.6.3 + vitest: + specifier: ^1.2.1 + version: 1.2.1(@types/node@18.19.71)(jsdom@25.0.1(bufferutil@4.0.9)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@6.0.5))(terser@5.37.0) packages/client-telegram: dependencies: @@ -2027,7 +2027,7 @@ importers: version: 29.5.14 jest: specifier: 29.7.0 - version: 29.7.0(@types/node@22.10.7)(babel-plugin-macros@3.1.0) + version: 29.7.0(@types/node@22.10.7)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@22.10.7)(typescript@5.7.3)) tsup: specifier: 8.3.5 version: 8.3.5(@swc/core@1.10.7(@swc/helpers@0.5.15))(jiti@2.4.2)(postcss@8.5.1)(tsx@4.19.2)(typescript@5.6.3)(yaml@2.7.0) @@ -2047,6 +2047,58 @@ importers: specifier: 7.1.0 version: 7.1.0 + packages/plugin-injective: + dependencies: + '@elizaos/adapter-sqlite': + specifier: 0.1.7-alpha.2 + version: 0.1.7-alpha.2(@google-cloud/vertexai@1.9.2(encoding@0.1.13))(@langchain/core@0.3.30(openai@4.73.0(encoding@0.1.13)(zod@3.23.8)))(@langchain/groq@0.1.3(@langchain/core@0.3.30(openai@4.73.0(encoding@0.1.13)(zod@3.23.8)))(encoding@0.1.13))(axios@1.7.9)(encoding@0.1.13)(react@19.0.0)(sswr@2.1.0(svelte@5.18.0))(svelte@5.18.0)(whatwg-url@14.1.0) + '@elizaos/core': + specifier: workspace:* + version: link:../core + injective-sdk-client-ts: + specifier: file:../../packages/plugin-injective/injective-sdk-client-ts + version: '@injectivelabs/injective-sdk-client-ts@file:packages/plugin-injective/injective-sdk-client-ts(@types/react@19.0.7)(bufferutil@4.0.9)(google-protobuf@3.21.4)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(utf-8-validate@6.0.5)' + devDependencies: + '@types/chai': + specifier: ^5.0.1 + version: 5.0.1 + '@types/jest': + specifier: ^29.5.14 + version: 29.5.14 + '@types/node': + specifier: ^22.10.3 + version: 22.10.7 + '@types/sinon': + specifier: ^17.0.3 + version: 17.0.3 + '@typescript-eslint/eslint-plugin': + specifier: 8.16.0 + version: 8.16.0(@typescript-eslint/parser@8.16.0(eslint@9.16.0(jiti@2.4.2))(typescript@5.7.3))(eslint@9.16.0(jiti@2.4.2))(typescript@5.7.3) + '@typescript-eslint/parser': + specifier: 8.16.0 + version: 8.16.0(eslint@9.16.0(jiti@2.4.2))(typescript@5.7.3) + chai: + specifier: ^5.1.2 + version: 5.1.2 + eslint: + specifier: 9.16.0 + version: 9.16.0(jiti@2.4.2) + jest: + specifier: ^29.7.0 + version: 29.7.0(@types/node@22.10.7)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@22.10.7)(typescript@5.7.3)) + prettier: + specifier: 3.4.1 + version: 3.4.1 + sinon: + specifier: ^19.0.2 + version: 19.0.2 + ts-jest: + specifier: ^29.2.5 + version: 29.2.5(@babel/core@7.26.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.0))(esbuild@0.24.2)(jest@29.7.0(@types/node@22.10.7)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@22.10.7)(typescript@5.7.3)))(typescript@5.7.3) + typescript: + specifier: ^5.7.2 + version: 5.7.3 + packages/plugin-intiface: dependencies: '@elizaos/core': @@ -3516,6 +3568,24 @@ packages: resolution: {integrity: sha512-+JfuYFmjh2Yz3E3tPgoCXJAz5LoRUGq30eJOiCQBvXWwz3agjS2pwX4L4T+uvcWNFlRCjUHsmbsqKVDa7kf3Rw==} hasBin: true + '@apollo/client@3.12.6': + resolution: {integrity: sha512-MOEtkojZagMKB7nxlwQ426eaBYwEs/Xfn+JeLOd81wv6j7toKo57eEGAbJdZwyXGRgtiqDkX5gx3EzE7qtarXA==} + peerDependencies: + graphql: ^15.0.0 || ^16.0.0 + graphql-ws: ^5.5.5 + react: ^16.8.0 || ^17.0.0 || ^18.0.0 || >=19.0.0-rc + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 || >=19.0.0-rc + subscriptions-transport-ws: ^0.9.0 || ^0.11.0 + peerDependenciesMeta: + graphql-ws: + optional: true + react: + optional: true + react-dom: + optional: true + subscriptions-transport-ws: + optional: true + '@aptos-labs/aptos-cli@1.0.2': resolution: {integrity: sha512-PYPsd0Kk3ynkxNfe3S4fanI3DiUICCoh4ibQderbvjPFL5A0oK6F4lPEO2t0MDsQySTk2t4vh99Xjy6Bd9y+aQ==} hasBin: true @@ -5319,6 +5389,14 @@ packages: '@electric-sql/pglite@0.2.15': resolution: {integrity: sha512-Jiq31Dnk+rg8rMhcSxs4lQvHTyizNo5b269c1gCC3ldQ0sCLrNVPGzy+KnmonKy1ZArTUuXZf23/UamzFMKVaA==} + '@elizaos/adapter-sqlite@0.1.7-alpha.2': + resolution: {integrity: sha512-T6G/Y6FRihIOS+hvY95nLRha1xQGj7omKlhfaC15ZixVZDRLufGeJ+IuN0ecNLLgnf2A7+y3mmFrs1/pQqWkZw==} + peerDependencies: + whatwg-url: 7.1.0 + + '@elizaos/core@0.1.7-alpha.2': + resolution: {integrity: sha512-gNvFw/Xnv4dlcfmmKxRa+baKq6en4TitAjUGvo8LgAUkSk156A0fffJ0lAsc1rX8zMB5NsIqdvMCbwKxDd54OQ==} + '@emnapi/core@1.3.1': resolution: {integrity: sha512-pVGjBIt1Y6gg3EJN8jTcfpP/+uuRksIo055oE/OBkDNcjZqVbfkWCksG1Jp4yZnj3iKWyWX8fdG/j6UDYPbFog==} @@ -5410,6 +5488,12 @@ packages: cpu: [ppc64] os: [aix] + '@esbuild/android-arm64@0.17.19': + resolution: {integrity: sha512-KBMWvEZooR7+kzY0BtbTQn0OAYY7CsiydT63pVEaPtVYF0hXbUaOyZog37DKxK7NF3XacBJOpYT4adIJh+avxA==} + engines: {node: '>=12'} + cpu: [arm64] + os: [android] + '@esbuild/android-arm64@0.19.12': resolution: {integrity: sha512-P0UVNGIienjZv3f5zq0DP3Nt2IE/3plFzuaS96vihvD0Hd6H/q4WXUGpCxD/E8YrSXfNyRPbpTq+T8ZQioSuPA==} engines: {node: '>=12'} @@ -5434,6 +5518,12 @@ packages: cpu: [arm64] os: [android] + '@esbuild/android-arm@0.17.19': + resolution: {integrity: sha512-rIKddzqhmav7MSmoFCmDIb6e2W57geRsM94gV2l38fzhXMwq7hZoClug9USI2pFRGL06f4IOPHHpFNOkWieR8A==} + engines: {node: '>=12'} + cpu: [arm] + os: [android] + '@esbuild/android-arm@0.19.12': resolution: {integrity: sha512-qg/Lj1mu3CdQlDEEiWrlC4eaPZ1KztwGJ9B6J+/6G+/4ewxJg7gqj8eVYWvao1bXrqGiW2rsBZFSX3q2lcW05w==} engines: {node: '>=12'} @@ -5458,6 +5548,12 @@ packages: cpu: [arm] os: [android] + '@esbuild/android-x64@0.17.19': + resolution: {integrity: sha512-uUTTc4xGNDT7YSArp/zbtmbhO0uEEK9/ETW29Wk1thYUJBz3IVnvgEiEwEa9IeLyvnpKrWK64Utw2bgUmDveww==} + engines: {node: '>=12'} + cpu: [x64] + os: [android] + '@esbuild/android-x64@0.19.12': resolution: {integrity: sha512-3k7ZoUW6Q6YqhdhIaq/WZ7HwBpnFBlW905Fa4s4qWJyiNOgT1dOqDiVAQFwBH7gBRZr17gLrlFCRzF6jFh7Kew==} engines: {node: '>=12'} @@ -5482,6 +5578,12 @@ packages: cpu: [x64] os: [android] + '@esbuild/darwin-arm64@0.17.19': + resolution: {integrity: sha512-80wEoCfF/hFKM6WE1FyBHc9SfUblloAWx6FJkFWTWiCoht9Mc0ARGEM47e67W9rI09YoUxJL68WHfDRYEAvOhg==} + engines: {node: '>=12'} + cpu: [arm64] + os: [darwin] + '@esbuild/darwin-arm64@0.19.12': resolution: {integrity: sha512-B6IeSgZgtEzGC42jsI+YYu9Z3HKRxp8ZT3cqhvliEHovq8HSX2YX8lNocDn79gCKJXOSaEot9MVYky7AKjCs8g==} engines: {node: '>=12'} @@ -5506,6 +5608,12 @@ packages: cpu: [arm64] os: [darwin] + '@esbuild/darwin-x64@0.17.19': + resolution: {integrity: sha512-IJM4JJsLhRYr9xdtLytPLSH9k/oxR3boaUIYiHkAawtwNOXKE8KoU8tMvryogdcT8AU+Bflmh81Xn6Q0vTZbQw==} + engines: {node: '>=12'} + cpu: [x64] + os: [darwin] + '@esbuild/darwin-x64@0.19.12': resolution: {integrity: sha512-hKoVkKzFiToTgn+41qGhsUJXFlIjxI/jSYeZf3ugemDYZldIXIxhvwN6erJGlX4t5h417iFuheZ7l+YVn05N3A==} engines: {node: '>=12'} @@ -5530,6 +5638,12 @@ packages: cpu: [x64] os: [darwin] + '@esbuild/freebsd-arm64@0.17.19': + resolution: {integrity: sha512-pBwbc7DufluUeGdjSU5Si+P3SoMF5DQ/F/UmTSb8HXO80ZEAJmrykPyzo1IfNbAoaqw48YRpv8shwd1NoI0jcQ==} + engines: {node: '>=12'} + cpu: [arm64] + os: [freebsd] + '@esbuild/freebsd-arm64@0.19.12': resolution: {integrity: sha512-4aRvFIXmwAcDBw9AueDQ2YnGmz5L6obe5kmPT8Vd+/+x/JMVKCgdcRwH6APrbpNXsPz+K653Qg8HB/oXvXVukA==} engines: {node: '>=12'} @@ -5554,6 +5668,12 @@ packages: cpu: [arm64] os: [freebsd] + '@esbuild/freebsd-x64@0.17.19': + resolution: {integrity: sha512-4lu+n8Wk0XlajEhbEffdy2xy53dpR06SlzvhGByyg36qJw6Kpfk7cp45DR/62aPH9mtJRmIyrXAS5UWBrJT6TQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [freebsd] + '@esbuild/freebsd-x64@0.19.12': resolution: {integrity: sha512-EYoXZ4d8xtBoVN7CEwWY2IN4ho76xjYXqSXMNccFSx2lgqOG/1TBPW0yPx1bJZk94qu3tX0fycJeeQsKovA8gg==} engines: {node: '>=12'} @@ -5578,6 +5698,12 @@ packages: cpu: [x64] os: [freebsd] + '@esbuild/linux-arm64@0.17.19': + resolution: {integrity: sha512-ct1Tg3WGwd3P+oZYqic+YZF4snNl2bsnMKRkb3ozHmnM0dGWuxcPTTntAF6bOP0Sp4x0PjSF+4uHQ1xvxfRKqg==} + engines: {node: '>=12'} + cpu: [arm64] + os: [linux] + '@esbuild/linux-arm64@0.19.12': resolution: {integrity: sha512-EoTjyYyLuVPfdPLsGVVVC8a0p1BFFvtpQDB/YLEhaXyf/5bczaGeN15QkR+O4S5LeJ92Tqotve7i1jn35qwvdA==} engines: {node: '>=12'} @@ -5602,6 +5728,12 @@ packages: cpu: [arm64] os: [linux] + '@esbuild/linux-arm@0.17.19': + resolution: {integrity: sha512-cdmT3KxjlOQ/gZ2cjfrQOtmhG4HJs6hhvm3mWSRDPtZ/lP5oe8FWceS10JaSJC13GBd4eH/haHnqf7hhGNLerA==} + engines: {node: '>=12'} + cpu: [arm] + os: [linux] + '@esbuild/linux-arm@0.19.12': resolution: {integrity: sha512-J5jPms//KhSNv+LO1S1TX1UWp1ucM6N6XuL6ITdKWElCu8wXP72l9MM0zDTzzeikVyqFE6U8YAV9/tFyj0ti+w==} engines: {node: '>=12'} @@ -5626,6 +5758,12 @@ packages: cpu: [arm] os: [linux] + '@esbuild/linux-ia32@0.17.19': + resolution: {integrity: sha512-w4IRhSy1VbsNxHRQpeGCHEmibqdTUx61Vc38APcsRbuVgK0OPEnQ0YD39Brymn96mOx48Y2laBQGqgZ0j9w6SQ==} + engines: {node: '>=12'} + cpu: [ia32] + os: [linux] + '@esbuild/linux-ia32@0.19.12': resolution: {integrity: sha512-Thsa42rrP1+UIGaWz47uydHSBOgTUnwBwNq59khgIwktK6x60Hivfbux9iNR0eHCHzOLjLMLfUMLCypBkZXMHA==} engines: {node: '>=12'} @@ -5650,6 +5788,12 @@ packages: cpu: [ia32] os: [linux] + '@esbuild/linux-loong64@0.17.19': + resolution: {integrity: sha512-2iAngUbBPMq439a+z//gE+9WBldoMp1s5GWsUSgqHLzLJ9WoZLZhpwWuym0u0u/4XmZ3gpHmzV84PonE+9IIdQ==} + engines: {node: '>=12'} + cpu: [loong64] + os: [linux] + '@esbuild/linux-loong64@0.19.12': resolution: {integrity: sha512-LiXdXA0s3IqRRjm6rV6XaWATScKAXjI4R4LoDlvO7+yQqFdlr1Bax62sRwkVvRIrwXxvtYEHHI4dm50jAXkuAA==} engines: {node: '>=12'} @@ -5674,6 +5818,12 @@ packages: cpu: [loong64] os: [linux] + '@esbuild/linux-mips64el@0.17.19': + resolution: {integrity: sha512-LKJltc4LVdMKHsrFe4MGNPp0hqDFA1Wpt3jE1gEyM3nKUvOiO//9PheZZHfYRfYl6AwdTH4aTcXSqBerX0ml4A==} + engines: {node: '>=12'} + cpu: [mips64el] + os: [linux] + '@esbuild/linux-mips64el@0.19.12': resolution: {integrity: sha512-fEnAuj5VGTanfJ07ff0gOA6IPsvrVHLVb6Lyd1g2/ed67oU1eFzL0r9WL7ZzscD+/N6i3dWumGE1Un4f7Amf+w==} engines: {node: '>=12'} @@ -5698,6 +5848,12 @@ packages: cpu: [mips64el] os: [linux] + '@esbuild/linux-ppc64@0.17.19': + resolution: {integrity: sha512-/c/DGybs95WXNS8y3Ti/ytqETiW7EU44MEKuCAcpPto3YjQbyK3IQVKfF6nbghD7EcLUGl0NbiL5Rt5DMhn5tg==} + engines: {node: '>=12'} + cpu: [ppc64] + os: [linux] + '@esbuild/linux-ppc64@0.19.12': resolution: {integrity: sha512-nYJA2/QPimDQOh1rKWedNOe3Gfc8PabU7HT3iXWtNUbRzXS9+vgB0Fjaqr//XNbd82mCxHzik2qotuI89cfixg==} engines: {node: '>=12'} @@ -5722,6 +5878,12 @@ packages: cpu: [ppc64] os: [linux] + '@esbuild/linux-riscv64@0.17.19': + resolution: {integrity: sha512-FC3nUAWhvFoutlhAkgHf8f5HwFWUL6bYdvLc/TTuxKlvLi3+pPzdZiFKSWz/PF30TB1K19SuCxDTI5KcqASJqA==} + engines: {node: '>=12'} + cpu: [riscv64] + os: [linux] + '@esbuild/linux-riscv64@0.19.12': resolution: {integrity: sha512-2MueBrlPQCw5dVJJpQdUYgeqIzDQgw3QtiAHUC4RBz9FXPrskyyU3VI1hw7C0BSKB9OduwSJ79FTCqtGMWqJHg==} engines: {node: '>=12'} @@ -5746,6 +5908,12 @@ packages: cpu: [riscv64] os: [linux] + '@esbuild/linux-s390x@0.17.19': + resolution: {integrity: sha512-IbFsFbxMWLuKEbH+7sTkKzL6NJmG2vRyy6K7JJo55w+8xDk7RElYn6xvXtDW8HCfoKBFK69f3pgBJSUSQPr+4Q==} + engines: {node: '>=12'} + cpu: [s390x] + os: [linux] + '@esbuild/linux-s390x@0.19.12': resolution: {integrity: sha512-+Pil1Nv3Umes4m3AZKqA2anfhJiVmNCYkPchwFJNEJN5QxmTs1uzyy4TvmDrCRNT2ApwSari7ZIgrPeUx4UZDg==} engines: {node: '>=12'} @@ -5770,6 +5938,12 @@ packages: cpu: [s390x] os: [linux] + '@esbuild/linux-x64@0.17.19': + resolution: {integrity: sha512-68ngA9lg2H6zkZcyp22tsVt38mlhWde8l3eJLWkyLrp4HwMUr3c1s/M2t7+kHIhvMjglIBrFpncX1SzMckomGw==} + engines: {node: '>=12'} + cpu: [x64] + os: [linux] + '@esbuild/linux-x64@0.19.12': resolution: {integrity: sha512-B71g1QpxfwBvNrfyJdVDexenDIt1CiDN1TIXLbhOw0KhJzE78KIFGX6OJ9MrtC0oOqMWf+0xop4qEU8JrJTwCg==} engines: {node: '>=12'} @@ -5800,6 +5974,12 @@ packages: cpu: [arm64] os: [netbsd] + '@esbuild/netbsd-x64@0.17.19': + resolution: {integrity: sha512-CwFq42rXCR8TYIjIfpXCbRX0rp1jo6cPIUPSaWwzbVI4aOfX96OXY8M6KNmtPcg7QjYeDmN+DD0Wp3LaBOLf4Q==} + engines: {node: '>=12'} + cpu: [x64] + os: [netbsd] + '@esbuild/netbsd-x64@0.19.12': resolution: {integrity: sha512-3ltjQ7n1owJgFbuC61Oj++XhtzmymoCihNFgT84UAmJnxJfm4sYCiSLTXZtE00VWYpPMYc+ZQmB6xbSdVh0JWA==} engines: {node: '>=12'} @@ -5836,6 +6016,12 @@ packages: cpu: [arm64] os: [openbsd] + '@esbuild/openbsd-x64@0.17.19': + resolution: {integrity: sha512-cnq5brJYrSZ2CF6c35eCmviIN3k3RczmHz8eYaVlNasVqsNY+JKohZU5MKmaOI+KkllCdzOKKdPs762VCPC20g==} + engines: {node: '>=12'} + cpu: [x64] + os: [openbsd] + '@esbuild/openbsd-x64@0.19.12': resolution: {integrity: sha512-RbrfTB9SWsr0kWmb9srfF+L933uMDdu9BIzdA7os2t0TXhCRjrQyCeOt6wVxr79CKD4c+p+YhCj31HBkYcXebw==} engines: {node: '>=12'} @@ -5860,6 +6046,12 @@ packages: cpu: [x64] os: [openbsd] + '@esbuild/sunos-x64@0.17.19': + resolution: {integrity: sha512-vCRT7yP3zX+bKWFeP/zdS6SqdWB8OIpaRq/mbXQxTGHnIxspRtigpkUcDMlSCOejlHowLqII7K2JKevwyRP2rg==} + engines: {node: '>=12'} + cpu: [x64] + os: [sunos] + '@esbuild/sunos-x64@0.19.12': resolution: {integrity: sha512-HKjJwRrW8uWtCQnQOz9qcU3mUZhTUQvi56Q8DPTLLB+DawoiQdjsYq+j+D3s9I8VFtDr+F9CjgXKKC4ss89IeA==} engines: {node: '>=12'} @@ -5884,6 +6076,12 @@ packages: cpu: [x64] os: [sunos] + '@esbuild/win32-arm64@0.17.19': + resolution: {integrity: sha512-yYx+8jwowUstVdorcMdNlzklLYhPxjniHWFKgRqH7IFlUEa0Umu3KuYplf1HUZZ422e3NU9F4LGb+4O0Kdcaag==} + engines: {node: '>=12'} + cpu: [arm64] + os: [win32] + '@esbuild/win32-arm64@0.19.12': resolution: {integrity: sha512-URgtR1dJnmGvX864pn1B2YUYNzjmXkuJOIqG2HdU62MVS4EHpU2946OZoTMnRUHklGtJdJZ33QfzdjGACXhn1A==} engines: {node: '>=12'} @@ -5908,6 +6106,12 @@ packages: cpu: [arm64] os: [win32] + '@esbuild/win32-ia32@0.17.19': + resolution: {integrity: sha512-eggDKanJszUtCdlVs0RB+h35wNlb5v4TWEkq4vZcmVt5u/HiDZrTXe2bWFQUez3RgNHwx/x4sk5++4NSSicKkw==} + engines: {node: '>=12'} + cpu: [ia32] + os: [win32] + '@esbuild/win32-ia32@0.19.12': resolution: {integrity: sha512-+ZOE6pUkMOJfmxmBZElNOx72NKpIa/HFOMGzu8fqzQJ5kgf6aTGrcJaFsNiVMH4JKpMipyK+7k0n2UXN7a8YKQ==} engines: {node: '>=12'} @@ -5932,6 +6136,12 @@ packages: cpu: [ia32] os: [win32] + '@esbuild/win32-x64@0.17.19': + resolution: {integrity: sha512-lAhycmKnVOuRYNtRtatQR1LPQf2oYCkRGkSFnseDAKPl8lu5SOsK/e1sXe5a0Pc5kHIHe6P2I/ilntNv2xf3cA==} + engines: {node: '>=12'} + cpu: [x64] + os: [win32] + '@esbuild/win32-x64@0.19.12': resolution: {integrity: sha512-T1QyPSDCyMXaO3pzBkF96E8xMkiRYbUEZADd29SyPGabqxMViNoii+NcK7eWJAEoU6RZyEm5lVSIjTmcdoB9HA==} engines: {node: '>=12'} @@ -6514,6 +6724,81 @@ packages: peerDependencies: google-protobuf: ^3.14.0 + '@injectivelabs/core-proto-ts@1.13.4': + resolution: {integrity: sha512-81+bwey0qzNgOzUASsxYghSahcWzH5l6bSceW8FdR7w42+Knp+bAgbg12sSyS1hiOO2kMXx6tBvmYkCmnghM1Q==} + + '@injectivelabs/exceptions@1.14.33': + resolution: {integrity: sha512-2c8YzLgwTOOsyc1WheqdM8jEfgGBhVrXN4cZ0jsikFVsLF619IDRn3hjIYqTeNERaEpeRPiuJGfZDu0DomwFrQ==} + + '@injectivelabs/exceptions@1.14.34-beta.5': + resolution: {integrity: sha512-Tr6JYYp1WgJbr9QwuNrxM1xyeLRtZ9ah8jaIn37RBJzX00uxgAc46H5n2pSsr84G7R7c5gfEFfJ98o7X875dNQ==} + + '@injectivelabs/grpc-web-node-http-transport@0.0.2': + resolution: {integrity: sha512-rpyhXLiGY/UMs6v6YmgWHJHiO9l0AgDyVNv+jcutNVt4tQrmNvnpvz2wCAGOFtq5LuX/E9ChtTVpk3gWGqXcGA==} + peerDependencies: + '@injectivelabs/grpc-web': '>=0.0.1' + + '@injectivelabs/grpc-web-react-native-transport@0.0.2': + resolution: {integrity: sha512-mk+aukQXnYNgPsPnu3KBi+FD0ZHQpazIlaBZ2jNZG7QAVmxTWtv3R66Zoq99Wx2dnE946NsZBYAoa0K5oSjnow==} + peerDependencies: + '@injectivelabs/grpc-web': '>=0.0.1' + + '@injectivelabs/grpc-web@0.0.1': + resolution: {integrity: sha512-Pu5YgaZp+OvR5UWfqbrPdHer3+gDf+b5fQoY+t2VZx1IAVHX8bzbN9EreYTvTYtFeDpYRWM8P7app2u4EX5wTw==} + peerDependencies: + google-protobuf: ^3.14.0 + + '@injectivelabs/indexer-proto-ts@1.13.3': + resolution: {integrity: sha512-rLesVPCARl+OC82vj063/pUawYu0ISty/2+xg6ya4Lwk6PDbXmtRvw8wpNP6K+pAsBOKaSkRnO4ThP5qbX+E6A==} + + '@injectivelabs/injective-sdk-client-ts@file:packages/plugin-injective/injective-sdk-client-ts': + resolution: {directory: packages/plugin-injective/injective-sdk-client-ts, type: directory} + + '@injectivelabs/mito-proto-ts@1.13.0': + resolution: {integrity: sha512-DE9iK7PkEnkWAMTDJDH01R8jxkxVCNuurfVp/09Te9wY3dm3mRx9M6R756JywP2Sd/ggJl2UbavGAQe2pZ7v1w==} + + '@injectivelabs/networks@1.14.33': + resolution: {integrity: sha512-XDhAYwWYKdKBRfwO/MIfMyKjKRWz/AliMJG9yaM1C/cDlGHmA3EY7Au2Nf+PdkRhuxl2FzLV2Hp4uWeC0g8BYw==} + + '@injectivelabs/networks@1.14.34-beta.2': + resolution: {integrity: sha512-OleogANWicpKUcGMdybfFvxOubXY9fvj5MKea49Q2XO8ErTicaUijsWHUWSdTrW+XQJwH5FXaKHX/1jS7UbRFQ==} + + '@injectivelabs/networks@1.14.34-beta.5': + resolution: {integrity: sha512-VCgDhWfgpP5nyEwKelTm1IZWCKXgonkRlaRSMOxifkjcut5q2rwjpGuM5X0s18UkW3iV44C4p9otPDZCGML0NQ==} + + '@injectivelabs/olp-proto-ts@1.13.1': + resolution: {integrity: sha512-dKxse7mZpmvRhm00Wn8Yy93EVEvFD7FPWeWFfxga0Patow3HK0D7k43VV7fE5kX9CDM1bxTatEVQ7WYGq4w0Eg==} + + '@injectivelabs/sdk-ts@1.14.33': + resolution: {integrity: sha512-qEuu6yzhy8t8rtviCBqV1VMR+JAaDSy59Eebd23i+1P5zqQ9X2lZLLLxz+gWjiglWb8uQYsoLN3TFh2509WNzQ==} + + '@injectivelabs/sdk-ts@1.14.34-beta.2': + resolution: {integrity: sha512-L5T/GCm+3b0CjRS5SSNpT4Rq9OgsbtcnH3xcB2V/I9a/u+6AssNiG3CiNRnqjeU74GqH5+M3y/tKIIS0bsnrRw==} + + '@injectivelabs/test-utils@1.14.33': + resolution: {integrity: sha512-1SfIRsMnWcJAYNrrpY+ZUWmbD62lWWdIvD6c+FYmFKS14zU3yDIK9NXe9g1lTM/GdUVkVKQgGg2QAYZ5f2G/xA==} + + '@injectivelabs/test-utils@1.14.34-beta.8': + resolution: {integrity: sha512-X63Uqo7aCMBBAcnaxoKyQROtl/n/353epDL0JHLj8Uk4FIWfhox3bTdZcHGtwwZabJMadPlQliHIe5WhGxA/hA==} + + '@injectivelabs/token-metadata@1.14.11': + resolution: {integrity: sha512-WKJlvjKiTRHxpOeez4kYrzIwgWmpspD1IMxWclkTysAcwGltUfUsvUhu1cKuACleIjFFWmiZv/HoGRFdvEAZ8w==} + + '@injectivelabs/ts-types@1.14.33': + resolution: {integrity: sha512-sJZzMNJtZFFZoPKZ91G09bxrZqQ5aS9omoTjQWy+7OxfiRAakzhsarTueX47hm6oTaN0XeBgD3wkMukkWUaobw==} + + '@injectivelabs/ts-types@1.14.34-beta.2': + resolution: {integrity: sha512-iK50g0TI71Q8lxjl8DLa2qCdypxaPqEHRM/LZt7+vYuazX+2SVuavV4V81Dt0vUcu39DC9yB46FVwcjniCl60Q==} + + '@injectivelabs/utils@1.14.33': + resolution: {integrity: sha512-zsezML4dTujF0xGLhcGmWBCghfJiy9MW+r6VqR8zJUlxnmnEdNpmsvBhBI6cmmov6Se4FL+yALAIFRvTm3txbg==} + + '@injectivelabs/utils@1.14.34-beta.2': + resolution: {integrity: sha512-M1TCXZz4jr06zCZoFmoCLLyEuwQ1sObRAIngiUUf3R725oX0c1dpfWEqUmDR/U/MUvJI3Kna7wzyZ7NnBhU23A==} + + '@injectivelabs/utils@1.14.34-beta.5': + resolution: {integrity: sha512-x15HVMii1lwOVHUIgvgP0/QoRHNvMXHZSVswiQvcHDiy83IuUCZxc8/W0ELjKKfkIw66zM2pd0UBwJ0IMaJLzw==} + '@ioredis/commands@1.2.0': resolution: {integrity: sha512-Sx1pU8EM64o2BrqNpEO1CNLtKQwyhuXuqyfH7oGKCk+1a33d2r5saW8zNwm3j6BTExtjrv2BxTgzzkMwts6vGg==} @@ -6889,6 +7174,10 @@ packages: '@mermaid-js/parser@0.3.0': resolution: {integrity: sha512-HsvL6zgE5sUPGgkIDlmAWR1HTNHz2Iy11BAWPTa4Jjabkpguy4Ze2gzfLrg6pdRuBvFwgUYyxiaNqZwrEEXepA==} + '@metamask/eth-sig-util@4.0.1': + resolution: {integrity: sha512-tghyZKLHZjcdlDqCA3gNZmLeR0XvOE9U1qoQO9ohyAZT6Pya+H9vkBPcsyXytmYLNgVoin7CKCmweo/R43V+tQ==} + engines: {node: '>=12.0.0'} + '@metaplex-foundation/beet-solana@0.3.1': resolution: {integrity: sha512-tgyEl6dvtLln8XX81JyBvWjIiEcjTkUwZbrM5dIobTmoqMuGewSyk9CClno8qsMsFdB5T3jC91Rjeqmu/6xk2g==} @@ -9012,6 +9301,15 @@ packages: '@sinonjs/fake-timers@10.3.0': resolution: {integrity: sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==} + '@sinonjs/fake-timers@13.0.5': + resolution: {integrity: sha512-36/hTbH2uaWuGVERyC6da9YwGWnzUZXuPro/F2LfsdOsLnCojz/iSH8MxUt/FD2S5XBSVPhmArFUXcpCQ2Hkiw==} + + '@sinonjs/samsam@8.0.2': + resolution: {integrity: sha512-v46t/fwnhejRSFTGqbpn9u+LQ9xJDse10gNnPgAcxgdoCDMXj/G2asWAC/8Qs+BAZDicX+MNZouXT1A7c83kVw==} + + '@sinonjs/text-encoding@0.7.3': + resolution: {integrity: sha512-DE427ROAphMQzU4ENbliGYrBSYPXF+TtLg9S8vzeA+OF4ZKzoDdzfL8sxuMUGS/lgRhM6j1URSk9ghf7Xo1tyA==} + '@slack/events-api@3.0.1': resolution: {integrity: sha512-ReJzZRpCgwGtKrAT0tRMppO3zm72jmxsOlTgR7PGajv2oq/tOJSeVRm7RcGiwn3EPIuovKkD/mr4TTN4n801fQ==} engines: {node: '>=12.13.0', npm: '>=6.12.0'} @@ -9847,6 +10145,9 @@ packages: '@types/bluebird@3.5.42': resolution: {integrity: sha512-Jhy+MWRlro6UjVi578V/4ZGNfeCOcNCp0YaFNIUGFKlImowqwb1O/22wDVk3FDGMLqxdpOV3qQHD5fPEH4hK6A==} + '@types/bn.js@4.11.6': + resolution: {integrity: sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg==} + '@types/bn.js@5.1.6': resolution: {integrity: sha512-Xh8vSwUeMKeYYrj3cX4lGQgFSF/N03r+tv4AiLl1SucqV+uTQpxRcnM8AkXKHwYP9ZPXOYXRr2KPXpVlIvqh9w==} @@ -9868,6 +10169,9 @@ packages: '@types/chai@4.3.20': resolution: {integrity: sha512-/pC9HAB5I/xMlc5FP77qjCnI16ChlJfW0tGa0IUcFn38VJrTV6DeZ60NU5KZBtaOZqjdpwTWohz5HU1RrhiYxQ==} + '@types/chai@5.0.1': + resolution: {integrity: sha512-5T8ajsg3M/FOncpLYW7sdOcD6yf4+722sze/tc4KQV0P8Z2rAr3SAuHCIkYmYpt8VbcQlnz8SxlOlPQYefe4cA==} + '@types/chance@1.1.6': resolution: {integrity: sha512-V+pm3stv1Mvz8fSKJJod6CglNGVqEQ6OyuqitoDkWywEODM/eJd1eSuIp9xt6DrX8BWZ2eDSIzbw1tPCUTvGbQ==} @@ -9982,6 +10286,9 @@ packages: '@types/debug@4.1.12': resolution: {integrity: sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==} + '@types/deep-eql@4.0.2': + resolution: {integrity: sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==} + '@types/diff-match-patch@1.0.36': resolution: {integrity: sha512-xFdR6tkm0MWvBfO8xXCSsinYxHcqkQUlcHeSpMC2ukzOb6lwQAfDmW+Qt0AvlGd8HpsS28qKsB+oPeJn9I39jg==} @@ -10108,6 +10415,9 @@ packages: '@types/lodash.isstring@4.0.9': resolution: {integrity: sha512-sjGPpa15VBpMns/4s6Blm567JgxLVVu/eCYCe7h/TdQyPCz9lIhaLSISjN7ZC9cDXmUT2IM/4mNRw8OtYirziw==} + '@types/lodash.values@4.3.9': + resolution: {integrity: sha512-IJ20OEfqNwm3k8ENwoM3q0yOs4UMpgtD4GqxB4lwBHToGthHWqhyh5DdSgQjioocz0QK2SSBkJfCq95ZTV8BTw==} + '@types/lodash@4.17.14': resolution: {integrity: sha512-jsxagdikDiDBeIRaPYtArcT8my4tN1og7MtMRquFT3XNA6axxyHDRUemqDz/taRDdOUn0GnGHRCuff4q48sW9A==} @@ -10186,6 +10496,9 @@ packages: '@types/parse5@5.0.3': resolution: {integrity: sha512-kUNnecmtkunAoQ3CnjmMkzNU/gtxG8guhi+Fk2U/kOpIKjIMKnXGp4IJCgQJrXSgMsWYimYG4TGjz/UzbGEBTw==} + '@types/pbkdf2@3.1.2': + resolution: {integrity: sha512-uRwJqmiXmh9++aSu1VNEn3iIxWOhd8AHXNSdlaLfdAAdSTY9jYVeGWnzejM3dvrkbqE3/hyQkQQ29IFATEGlew==} + '@types/pdfjs-dist@2.10.378': resolution: {integrity: sha512-TRdIPqdsvKmPla44kVy4jv5Nt5vjMfVjbIEke1CRULIrwKNRC4lIiZvNYDJvbUMNCFPNIUcOKhXTyMJrX18IMA==} deprecated: This is a stub types definition. pdfjs-dist provides its own type definitions, so you do not need this installed. @@ -10246,6 +10559,9 @@ packages: '@types/sax@1.2.7': resolution: {integrity: sha512-rO73L89PJxeYM3s3pPPjiPgVVcymqU490g0YO5n5By0k2Erzj6tay/4lr1CHAAU4JyOWd1rpQ8bCf6cZfHU96A==} + '@types/secp256k1@4.0.6': + resolution: {integrity: sha512-hHxJU6PAEUn0TP4S/ZOzuTUvJWuZ6eIKeNKb5RBpODvSl6hp1Wrw4s7ATY50rklRCScUDpHzVA/DQdSjJ3UoYQ==} + '@types/semver@7.5.8': resolution: {integrity: sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==} @@ -10262,6 +10578,12 @@ packages: resolution: {integrity: sha512-OOi3kL+FZDnPhVzsfD37J88FNeZh6gQsGcLc95NbeURRGvmSjeXiDcyWzF2o3yh/gQAUn2uhh/e+CPCa5nwAxw==} deprecated: This is a stub types definition. sharp provides its own type definitions, so you do not need this installed. + '@types/sinon@17.0.3': + resolution: {integrity: sha512-j3uovdn8ewky9kRBG19bOwaZbexJu/XjtkHyjvUgt4xfPFz18dcORIMqnYh66Fx3Powhcr85NT5+er3+oViapw==} + + '@types/sinonjs__fake-timers@8.1.5': + resolution: {integrity: sha512-mQkU2jY8jJEF7YHjHvsQO8+3ughTL1mcnn96igfhONmR+fUPSKIkefQYpSe8bsly2Ep7oQbn/6VG5/9/0qcArQ==} + '@types/sockjs@0.3.36': resolution: {integrity: sha512-MK9V6NzAS1+Ud7JV9lJLFqW85VbC9dq3LmwZCuBe4wBDgKC0Kj/jd8Xl+nSviU+Qc3+m7umHHyHg//2KSa0a0Q==} @@ -10858,6 +11180,22 @@ packages: '@webassemblyjs/wast-printer@1.14.1': resolution: {integrity: sha512-kPSSXE6De1XOR820C90RIo2ogvZG+c3KiHzqUoO/F34Y2shGzesfqv7o57xrxovZJH/MetF5UjroJ/R/3isoiw==} + '@wry/caches@1.0.1': + resolution: {integrity: sha512-bXuaUNLVVkD20wcGBWRyo7j9N3TxePEWFZj2Y+r9OoUzfqmavM84+mFykRicNsBqatba5JLay1t48wxaXaWnlA==} + engines: {node: '>=8'} + + '@wry/context@0.7.4': + resolution: {integrity: sha512-jmT7Sb4ZQWI5iyu3lobQxICu2nC/vbUhP0vIdd6tHC9PTfenmRmuIFqktc6GH9cgi+ZHnsLWPvfSvc4DrYmKiQ==} + engines: {node: '>=8'} + + '@wry/equality@0.5.7': + resolution: {integrity: sha512-BRFORjsTuQv5gxcXsuDXx6oGRhuVsEGwZy6LOzRRfgu+eSfxbhUQ9L9YtSEIuIjY/o7g3iWFjrc5eSY1GXP2Dw==} + engines: {node: '>=8'} + + '@wry/trie@0.5.0': + resolution: {integrity: sha512-FNoYzHawTMk/6KMQoEG5O4PuioX19UbwdQKF44yw0nLfOypfQdjtfZzo/UIJWAJ23sNIFbD1Ug9lbaDGMwbqQA==} + engines: {node: '>=8'} + '@xtuc/ieee754@1.2.0': resolution: {integrity: sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==} @@ -11141,6 +11479,10 @@ packages: resolution: {integrity: sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA==} engines: {node: '>=0.10.0'} + ansi-styles@3.2.1: + resolution: {integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==} + engines: {node: '>=4'} + ansi-styles@4.3.0: resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} engines: {node: '>=8'} @@ -11679,6 +12021,9 @@ packages: blake2b@2.1.3: resolution: {integrity: sha512-pkDss4xFVbMb4270aCyGD3qLv92314Et+FsKzilCLxDz5DuZ2/1g3w4nmBbu6nKApPspnjG7JcwTjGZnduB1yg==} + blakejs@1.2.1: + resolution: {integrity: sha512-QXUSXI3QVc/gJME0dBpXrag1kbzOqCjCX8/b54ntNyW6sjtoqxqRk3LTmXzaJoh71zMsDCjM+47jS7XiwN/+fQ==} + blessed@0.1.81: resolution: {integrity: sha512-LoF5gae+hlmfORcG1M5+5XZi4LBmvlXTzwJWzUlPryN/SJdSflZvROM2TwkT0GMpq7oqT48NRd4GS7BiVBc5OQ==} engines: {node: '>= 0.8.0'} @@ -11874,6 +12219,12 @@ packages: builtin-status-codes@3.0.0: resolution: {integrity: sha512-HpGFw18DgFWlncDfjTa2rcQ4W88O1mC8e8yZ2AvQY5KDaktSTwo+KRf6nHK6FRI5FyRyb/5T6+TSxfP7QyGsmQ==} + bundle-require@4.2.1: + resolution: {integrity: sha512-7Q/6vkyYAwOmQNRw75x+4yRtZCZJXUDmHHlFdkiV0wgv/reNjtJwpu1jPJ0w2kbEpIM0uoKI3S4/f39dU7AjSA==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + peerDependencies: + esbuild: '>=0.17' + bundle-require@5.1.0: resolution: {integrity: sha512-3WrrOuZiyaaZPWiEt4G3+IffISVC9HYlWueJEBWED4ZH4aIAC2PnkdnuRrR94M+w6yGWn4AglWtJtBI8YqvgoA==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} @@ -12025,6 +12376,10 @@ packages: resolution: {integrity: sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A==} engines: {node: '>=0.10.0'} + chalk@2.4.2: + resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==} + engines: {node: '>=4'} + chalk@3.0.0: resolution: {integrity: sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==} engines: {node: '>=8'} @@ -12280,10 +12635,16 @@ packages: collect-v8-coverage@1.0.2: resolution: {integrity: sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q==} + color-convert@1.9.3: + resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==} + color-convert@2.0.1: resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} engines: {node: '>=7.0.0'} + color-name@1.1.3: + resolution: {integrity: sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==} + color-name@1.1.4: resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} @@ -12547,6 +12908,10 @@ packages: peerDependencies: webpack: ^5.1.0 + copyfiles@2.4.1: + resolution: {integrity: sha512-fereAvAvxDrQDOXybk3Qu3dPbOoKoysFMWtkY3mv5BsL8//OSZVL5DCLYqgRfY5cWirgRzlC+WSrxp6Bo3eNZg==} + hasBin: true + core-js-compat@3.40.0: resolution: {integrity: sha512-0XEDpr5y5mijvw8Lbc6E5AkjrHfp7eEoPlu36SWeAbcL8fn1G1ANe8DBlo2XoNN89oVpxWwOjYIPVzR4ZvsKCQ==} @@ -13337,6 +13702,10 @@ packages: resolution: {integrity: sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==} engines: {node: '>=0.3.1'} + diff@7.0.0: + resolution: {integrity: sha512-PJWHUb1RFevKCwaFA9RlG5tCd+FO5iRh9A8HEtkmBH2Li03iJriB6m6JIN4rGz3K3JLawI7/veA1xzRKP6ISBw==} + engines: {node: '>=0.3.1'} + diffie-hellman@5.0.3: resolution: {integrity: sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==} @@ -13688,6 +14057,11 @@ packages: peerDependencies: esbuild: '*' + esbuild@0.17.19: + resolution: {integrity: sha512-XQ0jAPFkK/u3LcVRcvVHQcTIqD6E2H1fvZMA5dQPSOWb3suUbWbfbRf94pjc0bNzRYLfIrDRQXr7X+LHIm5oHw==} + engines: {node: '>=12'} + hasBin: true + esbuild@0.19.12: resolution: {integrity: sha512-aARqgq8roFBj054KvQr5f1sFu0D65G+miZRCuJyJ0G13Zwx7vRar5Zhn2tkQNzIXcBrNVsv/8stehpj+GAjgbg==} engines: {node: '>=12'} @@ -13958,6 +14332,9 @@ packages: ethereum-bloom-filters@1.2.0: resolution: {integrity: sha512-28hyiE7HVsWubqhpVLVmZXFd4ITeHi+BUu05o9isf0GUpMtzBUi+8/gFrGaGYzvGAJQmJ3JKj77Mk9G98T84rA==} + ethereum-cryptography@0.1.3: + resolution: {integrity: sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==} + ethereum-cryptography@2.2.1: resolution: {integrity: sha512-r/W8lkHSiTLxUxW8Rf3u4HGB0xQweG2RyETjywylKZSzLWoWAijRz8WCuOtJ6wah+avllXBqZuk29HCCvhEIRg==} @@ -13965,6 +14342,17 @@ packages: resolution: {integrity: sha512-Ij7U9OgVZc4MAui8BttPCEaWUrAXy+eo2IbVfIxZyfzfFxMQrbIWXRUbrsRBqRrIhJ75T8P+KQRKpKTaG0Du8Q==} engines: {node: ^14.21.3 || >=16, npm: '>=9'} + ethereumjs-abi@0.6.8: + resolution: {integrity: sha512-Tx0r/iXI6r+lRsdvkFDlut0N08jWMnKRZ6Gkq+Nmw75lZe4e6o3EkSnkaBP5NF6+m5PTGAr9JP43N3LyeoglsA==} + deprecated: This library has been deprecated and usage is discouraged. + + ethereumjs-util@6.2.1: + resolution: {integrity: sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==} + + ethereumjs-util@7.1.5: + resolution: {integrity: sha512-SDl5kKrQAudFBUe5OJM9Ac6WmMyYmXX/6sTmLZ3ffG2eY6ZIGBes3pEDxNN6V72WyOw4CPD5RomKdsa8DAAwLg==} + engines: {node: '>=10.0.0'} + ethers-multicall-provider@5.0.0: resolution: {integrity: sha512-dsfIwBSbr8yG+F0o87uoMFje1k5w988883MMJvK7R66mYT6NApQhQ7sMH/cxKGXTRf3at+nGt/4QIYHbYhe/8A==} engines: {node: '>=12.0'} @@ -13986,6 +14374,10 @@ packages: resolution: {integrity: sha512-/Sn9Y0oKl0uqQuvgFk/zQgR7aw1g36qX/jzSQ5lSwlO0GigPymk4eGQfeNTD03w1dPOqfz8V77Cy43jH56pagw==} engines: {node: '>=6.5.0', npm: '>=3'} + ethjs-util@0.1.6: + resolution: {integrity: sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w==} + engines: {node: '>=6.5.0', npm: '>=3'} + eval@0.1.8: resolution: {integrity: sha512-EzV94NYKoO09GLXGjXj9JIlXijVck4ONSr5wiCWDvhsvj5jxSrzTmRU/9C1DyB6uToszLs8aifA6NQ7lEQdvFw==} engines: {node: '>= 0.8'} @@ -15102,6 +15494,9 @@ packages: resolution: {integrity: sha512-CAbnr6Rz4CYQkLYUtSNXxQPUH2gK8f3iWexVlsnMeD+GjlsQ0Xsy1cOX+mN3dtxYomRy21CiOzU8Uhw6OwncEQ==} engines: {node: '>=0.8', npm: '>=1.3.7'} + http-status-codes@2.3.0: + resolution: {integrity: sha512-RJ8XvFvpPM/Dmc5SV+dC4y5PCeOhT3x1Hq0NU3rjGeg5a/CqlhZ7uudknPwZFz4aeAXDcbAyaeP7GAo9lvngtA==} + http2-wrapper@1.0.3: resolution: {integrity: sha512-V+23sDMr12Wnz7iTcDeJr3O6AIxlnvT/bmaAAAP/Xda35C90p9599p0F1eHR/N1KILWSoWVAiOMFjBBXaXSMxg==} engines: {node: '>=10.19.0'} @@ -15994,6 +16389,10 @@ packages: jsbn@1.1.0: resolution: {integrity: sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==} + jscrypto@1.0.3: + resolution: {integrity: sha512-lryZl0flhodv4SZHOqyb1bx5sKcJxj0VBo0Kzb4QMAg3L021IC9uGpl0RCZa+9KJwlRGSK2C80ITcwbe19OKLQ==} + hasBin: true + jsdoc-type-pratt-parser@4.0.0: resolution: {integrity: sha512-YtOli5Cmzy3q4dP26GraSOeAhqecewG04hoO8DY56CH4KJ9Fvv5qKWUCCo3HZob7esJQHCv6/+bnTy72xZZaVQ==} engines: {node: '>=12.0.0'} @@ -16089,6 +16488,9 @@ packages: resolution: {integrity: sha512-p/nXbhSEcu3pZRdkW1OfJhpsVtW1gd4Wa1fnQc9YLiTfAjn0312eMKimbdIQzuZl9aa9xUGaRlP9T/CJE/ditQ==} engines: {node: '>=0.10.0'} + jsonschema@1.5.0: + resolution: {integrity: sha512-K+A9hhqbn0f3pJX17Q/7H6yQfD/5OXgdrR5UE12gMXCiN9D5Xq2o5mddV2QEcX/bjla99ASsAAQUyMCCRWAEhw==} + jsonwebtoken@9.0.2: resolution: {integrity: sha512-PRp66vJ865SSqOlgqS8hujT5U4AOgMfhrwYIuIhfKaoSCZcirrmASQr8CX7cUg+RMih+hgznrjp99o+W4pJLHQ==} engines: {node: '>=12', npm: '>=6'} @@ -16116,6 +16518,9 @@ packages: just-diff@6.0.2: resolution: {integrity: sha512-S59eriX5u3/QhMNq3v/gm8Kd0w8OS6Tz2FS1NG4blv+z0MuQcBRJyFWjdovM0Rad4/P4aUPFtnkNjMjyMlMSYA==} + just-extend@6.2.0: + resolution: {integrity: sha512-cYofQu2Xpom82S6qD778jBDpwvvy39s1l/hrYij2u9AMdQcGRpaBu6kY4mVhuno5kJVi1DAz4aiphA2WI1/OAw==} + jwa@1.4.1: resolution: {integrity: sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==} @@ -16377,6 +16782,10 @@ packages: lifecycle-utils@1.7.3: resolution: {integrity: sha512-T7zs7J6/sgsqwVyG34Sfo5LTQmlPmmqaUe3yBhdF8nq24RtR/HtbkNZRhNbr9BEaKySdSgH+P9H5U9X+p0WjXw==} + lilconfig@2.1.0: + resolution: {integrity: sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==} + engines: {node: '>=10'} + lilconfig@3.1.3: resolution: {integrity: sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw==} engines: {node: '>=14'} @@ -16388,6 +16797,11 @@ packages: resolution: {integrity: sha512-cNOjgCnLB+FnvWWtyRTzmB3POJ+cXxTA81LoW7u8JdmhfXzriropYwpjShnz1QLLWsQwY7nIxoDmcPTwphDK9w==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + link-module-alias@1.2.0: + resolution: {integrity: sha512-ahPjXepbSVKbahTB6LxR//VHm8HPfI+QQygCH+E82spBY4HR5VPJTvlhKBc9F7muVxnS6C1rRfoPOXAbWO/fyw==} + engines: {node: '> 8.0.0'} + hasBin: true + linkify-it@5.0.0: resolution: {integrity: sha512-5aHCbzQRADcdP+ATqnDuhhJ/MRIqDkZX5pyjFHRRysS8vZ5AbqGEoFIb6pYHPZ+L/OC2Lc+xT8uHVVR5CAK/wQ==} @@ -16490,6 +16904,9 @@ packages: lodash.defaults@4.2.0: resolution: {integrity: sha512-qjxPLHd3r5DnsdGacqOMU6pb/avJzdh9tFX2ymgoZE27BmjXrNy/y4LoaiTeAb+O3gL8AfpJGtqfX/ae2leYYQ==} + lodash.get@4.4.2: + resolution: {integrity: sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ==} + lodash.includes@4.3.0: resolution: {integrity: sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w==} @@ -16553,6 +16970,9 @@ packages: lodash.upperfirst@4.3.1: resolution: {integrity: sha512-sReKOYJIJf74dhJONhU4e0/shzi1trVbSWDOhKYE5XV2O+H7Sb2Dihwuc7xWxVl+DgFPyTqIN3zMfT9cq5iWDg==} + lodash.values@4.3.0: + resolution: {integrity: sha512-r0RwvdCv8id9TUblb/O7rYPwVy6lerCbcawrfdo9iC/1t1wsNMJknO79WNBgwkH0hIeJ08jmvvESbFpNb4jH0Q==} + lodash@4.17.21: resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} @@ -17397,6 +17817,9 @@ packages: next-tick@1.1.0: resolution: {integrity: sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==} + nise@6.1.1: + resolution: {integrity: sha512-aMSAzLVY7LyeM60gvBS423nBmIPP+Wy7St7hsb+8/fc1HmeoHJfLO8CKse4u3BtOZvQLJghYPI2i/1WZrEj5/g==} + no-case@3.0.4: resolution: {integrity: sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==} @@ -17515,6 +17938,9 @@ packages: engines: {node: '>=10'} hasBin: true + noms@0.0.0: + resolution: {integrity: sha512-lNDU9VJaOPxUmXcLb+HQFeUgQQPtMI24Gt6hgfuMHRJgMRHMF/qZ4HJD3GDru4sSw9IQl2jPjAYnQrdIeLbwow==} + nopt@1.0.10: resolution: {integrity: sha512-NWmpvLSqUrgrAC9HCuxEvb+PSloHpqVu+FqcO4eeF2h5qYRhA7ev6KvelyQAKtegUbC6RypJnlEOhd8vloNKYg==} hasBin: true @@ -17793,6 +18219,9 @@ packages: resolution: {integrity: sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A==} hasBin: true + optimism@0.18.1: + resolution: {integrity: sha512-mLXNwWPa9dgFyDqkNi54sjDyNJ9/fTI6WGBLgnXku1vdKY/jovHfZT5r+aiVeFFLOz+foPNOm5YJ4mqgld2GBQ==} + optional@0.1.4: resolution: {integrity: sha512-gtvrrCfkE08wKcgXaVwQVgwEQ8vel2dc5DDBn9RLQZ3YtmtkBss6A2HY6BnJH4N/4Ku97Ri/SF8sNWE2225WJw==} @@ -18110,6 +18539,10 @@ packages: path-to-regexp@3.3.0: resolution: {integrity: sha512-qyCH421YQPS2WFDxDjftfc1ZR5WKQzVzqsp4n9M2kQhVOo/ByahFoUNJfl58kOcEGfQ//7weFTDhm+ss8Ecxgw==} + path-to-regexp@8.2.0: + resolution: {integrity: sha512-TdrF7fW9Rphjq4RjrW0Kp2AW0Ahwu9sRGTkS6bvDi0SCwZlEZYmcfDbEsTz8RVk0EHIS/Vd1bv3JhG+1xZuAyQ==} + engines: {node: '>=16'} + path-type@3.0.0: resolution: {integrity: sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==} engines: {node: '>=4'} @@ -18557,6 +18990,18 @@ packages: peerDependencies: postcss: ^8.4 + postcss-load-config@3.1.4: + resolution: {integrity: sha512-6DiM4E7v4coTE4uzA8U//WhtPwyhiim3eyjEMFCnUpzbrkK9wJHgKDT2mR+HbtSrd/NubVaYTOpSpjUl8NQeRg==} + engines: {node: '>= 10'} + peerDependencies: + postcss: '>=8.0.9' + ts-node: '>=9.0.0' + peerDependenciesMeta: + postcss: + optional: true + ts-node: + optional: true + postcss-load-config@4.0.2: resolution: {integrity: sha512-bSVhyJGL00wMVoPUzAVAnbEoWyqRxkjv64tUl427SKnPrENtq6hJwUojroMz2VB+Q1edmi4IfrAPpami5VVgMQ==} engines: {node: '>= 14'} @@ -19696,6 +20141,17 @@ packages: resolution: {integrity: sha512-cnE+y8bz4NhMjISKbgeVJtqNbtf5QpjZP+Bslo+UqkIt9QPnX9q095eiRRASJG1/tz6dlNr6Z5NsBiWYokp6EQ==} hasBin: true + rehackt@0.1.0: + resolution: {integrity: sha512-7kRDOuLHB87D/JESKxQoRwv4DzbIdwkAGQ7p6QKGdVlY1IZheUnVhlk/4UZlNUVxdAXpyxikE3URsG067ybVzw==} + peerDependencies: + '@types/react': '*' + react: '*' + peerDependenciesMeta: + '@types/react': + optional: true + react: + optional: true + rehype-parse@7.0.1: resolution: {integrity: sha512-fOiR9a9xH+Le19i4fGzIEowAbwG7idy2Jzs4mOrFWBSJ0sNUgy0ev871dwWnbOo371SjgjG4pwzrbgSVrKxecw==} @@ -19818,6 +20274,10 @@ packages: resolution: {integrity: sha512-U7WjGVG9sH8tvjW5SmGbQuui75FiyjAX72HX15DwBBwF9dNiQZRQAg9nnPhYy+TUnE0+VcrttuvNI8oSxZcocA==} hasBin: true + response-iterator@0.2.16: + resolution: {integrity: sha512-QmLnoE4cJXjCoYjEtYu5zmBMs/1ytHU1RhbBm9/DUKTR641k46qCinzPiOzJJk9r71rxYbuMwM+dExPxlFTrzA==} + engines: {node: '>=0.8'} + responselike@2.0.1: resolution: {integrity: sha512-4gl03wn3hj1HP3yzgdI7d3lCkF95F21Pz4BPGvKHinyQzALR5CapwC8yIi0Rh58DEMQ/SguC03wFj2k0M/mHhw==} @@ -19870,6 +20330,10 @@ packages: ripemd160@2.0.2: resolution: {integrity: sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==} + rlp@2.2.7: + resolution: {integrity: sha512-d5gdPmgQ0Z+AklL2NVXr/IoSjNZFfTVvQWzL/AM2AOcSzYP2xjlb0AC8YyCLc41MSNf6P6QVtjgPdmVtzb+4lQ==} + hasBin: true + robot3@0.4.1: resolution: {integrity: sha512-hzjy826lrxzx8eRgv80idkf8ua1JAepRc9Efdtj03N3KNJuznQCPlyCJ7gnUmDFwZCLQjxy567mQVKmdv2BsXQ==} @@ -20027,6 +20491,10 @@ packages: search-insights@2.17.3: resolution: {integrity: sha512-RQPdCYTa8A68uM2jwxoY842xDhvx3E5LFL1LxvxCNMev4o5mLuokczhzjAgGwUZBAmOKZknArSxLKmXtIi2AxQ==} + secp256k1@4.0.4: + resolution: {integrity: sha512-6JfvwvjUOn8F/jUoBY2Q1v5WY5XS+rj8qSe0v8Y4ezH4InLgTEeOOPQsRll9OV429Pvo6BCHGavIyJfr3TAhsw==} + engines: {node: '>=18.0.0'} + secp256k1@5.0.0: resolution: {integrity: sha512-TKWX8xvoGHrxVdqbYeZM9w+izTF4b9z3NhSaDkdn81btvuh+ivbIMGT/zQvDtTFWhRlThpoz6LEYTr7n8A5GcA==} engines: {node: '>=14.0.0'} @@ -20197,6 +20665,11 @@ packages: shimmer@1.2.1: resolution: {integrity: sha512-sQTKC1Re/rM6XyFM6fIAGHRPVGvyXfgzIDvzoq608vM+jeyVD0Tu1E6Np0Kc2zAIFWIj963V2800iF/9LPieQw==} + shx@0.3.4: + resolution: {integrity: sha512-N6A9MLVqjxZYcVn8hLmtneQWIJtp8IKzMP4eMnx+nqkvXoqinUPCbUFLp2UcWTEIUONhlk0ewxr/jaVGlc+J+g==} + engines: {node: '>=6'} + hasBin: true + side-channel-list@1.0.0: resolution: {integrity: sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==} engines: {node: '>= 0.4'} @@ -20252,6 +20725,9 @@ packages: resolution: {integrity: sha512-a2B9Y0KlNXl9u/vsW6sTIu9vGEpfKu2wRV6l1H3XEas/0gUIzGzBoP/IouTcUQbm9JWZLH3COxyn03TYlFax6w==} engines: {node: '>=10'} + sinon@19.0.2: + resolution: {integrity: sha512-euuToqM+PjO4UgXeLETsfQiuoyPXlqFezr6YZDFwHR3t4qaX0fZUe1MfPMznTL5f8BWrVS89KduLdMUsxFCO6g==} + sirv@2.0.4: resolution: {integrity: sha512-94Bdh3cC2PKrbgSOUqTiGPWVZeSiXfKOVZNJniWoqrWrRkB1CJzBU3NEbiTsPcYy1lDsANA/THzS+9WBiy5nfQ==} engines: {node: '>= 10'} @@ -20310,6 +20786,10 @@ packages: resolution: {integrity: sha512-CjU5pyRfwOtaOITYv5C8DzpZ8XA/ieRsDpr93HI2r6e3YInC6moZpSQbmUtg8cTk58tq2x3jcG2gv+p1IZGmMA==} engines: {node: '>=8'} + snakecase-keys@5.5.0: + resolution: {integrity: sha512-r3kRtnoPu3FxGJ3fny6PKNnU3pteb29o6qAa0ugzhSseKNWRkw1dw8nIjXMyyKaU9vQxxVIE62Mb3bKbdrgpiw==} + engines: {node: '>=12'} + socket.io-client@4.8.1: resolution: {integrity: sha512-hJVXfu3E28NmzGk8o1sHhN3om52tRvwYeidbj7xKy2eIIse5IoKX3USlS6Tqt3BHAtflLIkCQBkzVrEEfWUyYQ==} engines: {node: '>=10.0.0'} @@ -20540,6 +21020,9 @@ packages: resolution: {integrity: sha512-yhPIQXjrlt1xv7dyPQg2P17URmXbuM5pdGkpiMB3RenprfiBlvK415Lctfe0eshk90oA7/tNq7WEiMK8RSP39A==} engines: {node: '>=18'} + store2@2.14.4: + resolution: {integrity: sha512-srTItn1GOvyvOycgxjAnPA63FZNwy0PTyUBFMHRM+hVFltAeoh0LmNBz9SZqUS9mMqGk8rfyWyXn3GH5ReJ8Zw==} + stream-browserify@3.0.0: resolution: {integrity: sha512-H73RAHsVBapbim0tU2JwwOiXUj+fikfiaoYAKHF3VJfA0pe2BCzkhAHBlLG6REzE+2WNZcxOXjK7lkso+9euLA==} @@ -20789,6 +21272,10 @@ packages: resolution: {integrity: sha512-sQV7phh2WCYAn81oAkakC5qjq2Ml0g8ozqz03wOGnx9dDlG1de6yrF+0RAzSJD8fPUow3PTSMf2SAbOGxb93BA==} engines: {node: '>=0.10'} + symbol-observable@4.0.0: + resolution: {integrity: sha512-b19dMThMV4HVFynSAM1++gBHAbk2Tc/osgLIBZMKsyqh34jb2e8Os7T6ZW/Bt3pJFdBTd2JwAnAAEQV7rSNvcQ==} + engines: {node: '>=0.10'} + symbol-tree@3.2.4: resolution: {integrity: sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==} @@ -21229,6 +21716,10 @@ packages: ts-interface-checker@0.1.13: resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} + ts-invariant@0.10.3: + resolution: {integrity: sha512-uivwYcQaxAucv1CzRp2n/QdYPo4ILf9VXgH19zEIjFx2EJufV16P0JtJVpYHy89DItG6Kwj2oIUjrcK5au+4tQ==} + engines: {node: '>=8'} + ts-jest@29.2.5: resolution: {integrity: sha512-KD8zB2aAZrcKIdGk4OwpJggeLcH1FgrICqDSROWqlnJXGCXK4Mn6FcdK2B6670Xr73lHMG1kHw8R87A0ecZ+vA==} engines: {node: ^14.15.0 || ^16.10.0 || ^18.0.0 || >=20.0.0} @@ -21316,6 +21807,22 @@ packages: resolution: {integrity: sha512-LxhtAkPDTkVCMQjt2h6eBVY28KCjikZqZfMcC15YBeNjkgUpdCfBu5HoiOTDu86v6smE8yOjyEktJ8hlbANHQA==} engines: {node: '>=0.6.x'} + tsup@6.7.0: + resolution: {integrity: sha512-L3o8hGkaHnu5TdJns+mCqFsDBo83bJ44rlK7e6VdanIvpea4ArPcU3swWGsLVbXak1PqQx/V+SSmFPujBK+zEQ==} + engines: {node: '>=14.18'} + hasBin: true + peerDependencies: + '@swc/core': ^1 + postcss: ^8.4.12 + typescript: '>=4.1.0' + peerDependenciesMeta: + '@swc/core': + optional: true + postcss: + optional: true + typescript: + optional: true + tsup@8.3.5: resolution: {integrity: sha512-Tunf6r6m6tnZsG9GYWndg0z8dEV7fD733VBFzFJ5Vcm1FtlXB8xBD/rtrBi2a3YKEV7hHtxiZtW5EAVADoe1pA==} engines: {node: '>=18'} @@ -21453,6 +21960,10 @@ packages: resolution: {integrity: sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==} engines: {node: '>=12.20'} + type-fest@3.13.1: + resolution: {integrity: sha512-tLq3bSNx+xSpwvAJnzrK0Ep5CLNWjvFTOp71URMaAEWBfRb9nnJiBoUe0tF8bI4ZFO3omgBR6NvnbzVUT3Ly4g==} + engines: {node: '>=14.16'} + type-fest@4.32.0: resolution: {integrity: sha512-rfgpoi08xagF3JSdtJlCwMq9DGNDE0IMh3Mkpc1wUypg9vPi786AiqeBBKcqvIkq42azsBM85N490fyZjeUftw==} engines: {node: '>=16'} @@ -21806,6 +22317,10 @@ packages: uploadthing: optional: true + untildify@4.0.0: + resolution: {integrity: sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==} + engines: {node: '>=8'} + untyped@1.5.2: resolution: {integrity: sha512-eL/8PlhLcMmlMDtNPKhyyz9kEBDS3Uk4yMu/ewlkT2WFbtzScjHWPJLdQLmaGPUKjXzwe9MumOtOgc4Fro96Kg==} hasBin: true @@ -22887,6 +23402,12 @@ packages: yup@1.6.1: resolution: {integrity: sha512-JED8pB50qbA4FOkDol0bYF/p60qSEDQqBD0/qeIrUCG1KbPBIQ776fCUNb9ldbPcSTxA69g/47XTo4TqWiuXOA==} + zen-observable-ts@1.2.5: + resolution: {integrity: sha512-QZWQekv6iB72Naeake9hS1KxHlotfRpe+WGNbNx5/ta+R3DNjVO2bswf63gXlWDcs+EMd7XY8HfVQyP1X6T4Zg==} + + zen-observable@0.8.15: + resolution: {integrity: sha512-PQ2PC7R9rslx84ndNBZB/Dkv8V8fZEpk83RLgXtYd0fwUgEjseMn1Dgajh2x6S8QbZAFa9p2qVCEuYZNgve0dQ==} + zimmerframe@1.1.2: resolution: {integrity: sha512-rAbqEGa8ovJy4pyBxZM70hg4pE6gDgaQ0Sl9M3enG3I0d6H4XSAM3GeNGLKnsBpuijUow064sf7ww1nutC5/3w==} @@ -23425,6 +23946,29 @@ snapshots: - debug - supports-color + '@apollo/client@3.12.6(@types/react@19.0.7)(graphql@16.10.0)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': + dependencies: + '@graphql-typed-document-node/core': 3.2.0(graphql@16.10.0) + '@wry/caches': 1.0.1 + '@wry/equality': 0.5.7 + '@wry/trie': 0.5.0 + graphql: 16.10.0 + graphql-tag: 2.12.6(graphql@16.10.0) + hoist-non-react-statics: 3.3.2 + optimism: 0.18.1 + prop-types: 15.8.1 + rehackt: 0.1.0(@types/react@19.0.7)(react@19.0.0) + response-iterator: 0.2.16 + symbol-observable: 4.0.0 + ts-invariant: 0.10.3 + tslib: 2.8.1 + zen-observable-ts: 1.2.5 + optionalDependencies: + react: 19.0.0 + react-dom: 19.0.0(react@19.0.0) + transitivePeerDependencies: + - '@types/react' + '@aptos-labs/aptos-cli@1.0.2': dependencies: commander: 12.1.0 @@ -25603,6 +26147,16 @@ snapshots: - bufferutil - utf-8-validate + '@cosmjs/socket@0.32.4(bufferutil@4.0.9)(utf-8-validate@6.0.5)': + dependencies: + '@cosmjs/stream': 0.32.4 + isomorphic-ws: 4.0.1(ws@7.5.10(bufferutil@4.0.9)(utf-8-validate@6.0.5)) + ws: 7.5.10(bufferutil@4.0.9)(utf-8-validate@6.0.5) + xstream: 11.14.0 + transitivePeerDependencies: + - bufferutil + - utf-8-validate + '@cosmjs/stargate@0.31.0-alpha.1(bufferutil@4.0.9)(utf-8-validate@5.0.10)': dependencies: '@confio/ics23': 0.6.8 @@ -25675,6 +26229,23 @@ snapshots: - debug - utf-8-validate + '@cosmjs/stargate@0.32.4(bufferutil@4.0.9)(utf-8-validate@6.0.5)': + dependencies: + '@confio/ics23': 0.6.8 + '@cosmjs/amino': 0.32.4 + '@cosmjs/encoding': 0.32.4 + '@cosmjs/math': 0.32.4 + '@cosmjs/proto-signing': 0.32.4 + '@cosmjs/stream': 0.32.4 + '@cosmjs/tendermint-rpc': 0.32.4(bufferutil@4.0.9)(utf-8-validate@6.0.5) + '@cosmjs/utils': 0.32.4 + cosmjs-types: 0.9.0 + xstream: 11.14.0 + transitivePeerDependencies: + - bufferutil + - debug + - utf-8-validate + '@cosmjs/stream@0.30.1': dependencies: xstream: 11.14.0 @@ -25738,6 +26309,23 @@ snapshots: - debug - utf-8-validate + '@cosmjs/tendermint-rpc@0.32.4(bufferutil@4.0.9)(utf-8-validate@6.0.5)': + dependencies: + '@cosmjs/crypto': 0.32.4 + '@cosmjs/encoding': 0.32.4 + '@cosmjs/json-rpc': 0.32.4 + '@cosmjs/math': 0.32.4 + '@cosmjs/socket': 0.32.4(bufferutil@4.0.9)(utf-8-validate@6.0.5) + '@cosmjs/stream': 0.32.4 + '@cosmjs/utils': 0.32.4 + axios: 1.7.9(debug@4.4.0) + readonly-date: 1.0.0 + xstream: 11.14.0 + transitivePeerDependencies: + - bufferutil + - debug + - utf-8-validate + '@cosmjs/utils@0.27.1': {} '@cosmjs/utils@0.31.3': {} @@ -27055,6 +27643,86 @@ snapshots: '@electric-sql/pglite@0.2.15': {} + '@elizaos/adapter-sqlite@0.1.7-alpha.2(@google-cloud/vertexai@1.9.2(encoding@0.1.13))(@langchain/core@0.3.30(openai@4.73.0(encoding@0.1.13)(zod@3.23.8)))(@langchain/groq@0.1.3(@langchain/core@0.3.30(openai@4.73.0(encoding@0.1.13)(zod@3.23.8)))(encoding@0.1.13))(axios@1.7.9)(encoding@0.1.13)(react@19.0.0)(sswr@2.1.0(svelte@5.18.0))(svelte@5.18.0)(whatwg-url@14.1.0)': + dependencies: + '@elizaos/core': 0.1.7-alpha.2(@google-cloud/vertexai@1.9.2(encoding@0.1.13))(@langchain/core@0.3.30(openai@4.73.0(encoding@0.1.13)(zod@3.23.8)))(@langchain/groq@0.1.3(@langchain/core@0.3.30(openai@4.73.0(encoding@0.1.13)(zod@3.23.8)))(encoding@0.1.13))(axios@1.7.9)(encoding@0.1.13)(react@19.0.0)(sswr@2.1.0(svelte@5.18.0))(svelte@5.18.0) + '@types/better-sqlite3': 7.6.12 + better-sqlite3: 11.6.0 + sqlite-vec: 0.1.6 + whatwg-url: 14.1.0 + transitivePeerDependencies: + - '@google-cloud/vertexai' + - '@langchain/anthropic' + - '@langchain/aws' + - '@langchain/cohere' + - '@langchain/core' + - '@langchain/google-genai' + - '@langchain/google-vertexai' + - '@langchain/groq' + - '@langchain/mistralai' + - '@langchain/ollama' + - axios + - cheerio + - encoding + - peggy + - react + - solid-js + - sswr + - supports-color + - svelte + - typeorm + - vue + + '@elizaos/core@0.1.7-alpha.2(@google-cloud/vertexai@1.9.2(encoding@0.1.13))(@langchain/core@0.3.30(openai@4.73.0(encoding@0.1.13)(zod@3.23.8)))(@langchain/groq@0.1.3(@langchain/core@0.3.30(openai@4.73.0(encoding@0.1.13)(zod@3.23.8)))(encoding@0.1.13))(axios@1.7.9)(encoding@0.1.13)(react@19.0.0)(sswr@2.1.0(svelte@5.18.0))(svelte@5.18.0)': + dependencies: + '@ai-sdk/anthropic': 0.0.56(zod@3.23.8) + '@ai-sdk/google': 0.0.55(zod@3.23.8) + '@ai-sdk/google-vertex': 0.0.43(@google-cloud/vertexai@1.9.2(encoding@0.1.13))(zod@3.23.8) + '@ai-sdk/groq': 0.0.3(zod@3.23.8) + '@ai-sdk/openai': 1.0.5(zod@3.23.8) + '@anthropic-ai/sdk': 0.30.1(encoding@0.1.13) + '@fal-ai/client': 1.2.0 + '@types/uuid': 10.0.0 + ai: 3.4.33(openai@4.73.0(encoding@0.1.13)(zod@3.23.8))(react@19.0.0)(sswr@2.1.0(svelte@5.18.0))(svelte@5.18.0)(vue@3.5.13(typescript@5.6.3))(zod@3.23.8) + anthropic-vertex-ai: 1.0.2(encoding@0.1.13)(zod@3.23.8) + fastembed: 1.14.1 + fastestsmallesttextencoderdecoder: 1.0.22 + gaxios: 6.7.1(encoding@0.1.13) + glob: 11.0.0 + handlebars: 4.7.8 + js-sha1: 0.7.0 + js-tiktoken: 1.0.15 + langchain: 0.3.6(@langchain/core@0.3.30(openai@4.73.0(encoding@0.1.13)(zod@3.23.8)))(@langchain/groq@0.1.3(@langchain/core@0.3.30(openai@4.73.0(encoding@0.1.13)(zod@3.23.8)))(encoding@0.1.13))(axios@1.7.9)(encoding@0.1.13)(handlebars@4.7.8)(openai@4.73.0(encoding@0.1.13)(zod@3.23.8)) + ollama-ai-provider: 0.16.1(zod@3.23.8) + openai: 4.73.0(encoding@0.1.13)(zod@3.23.8) + tinyld: 1.3.4 + together-ai: 0.7.0(encoding@0.1.13) + unique-names-generator: 4.7.1 + uuid: 11.0.3 + zod: 3.23.8 + transitivePeerDependencies: + - '@google-cloud/vertexai' + - '@langchain/anthropic' + - '@langchain/aws' + - '@langchain/cohere' + - '@langchain/core' + - '@langchain/google-genai' + - '@langchain/google-vertexai' + - '@langchain/groq' + - '@langchain/mistralai' + - '@langchain/ollama' + - axios + - cheerio + - encoding + - peggy + - react + - solid-js + - sswr + - supports-color + - svelte + - typeorm + - vue + '@emnapi/core@1.3.1': dependencies: '@emnapi/wasi-threads': 1.0.1 @@ -27169,6 +27837,9 @@ snapshots: '@esbuild/aix-ppc64@0.24.2': optional: true + '@esbuild/android-arm64@0.17.19': + optional: true + '@esbuild/android-arm64@0.19.12': optional: true @@ -27181,6 +27852,9 @@ snapshots: '@esbuild/android-arm64@0.24.2': optional: true + '@esbuild/android-arm@0.17.19': + optional: true + '@esbuild/android-arm@0.19.12': optional: true @@ -27193,6 +27867,9 @@ snapshots: '@esbuild/android-arm@0.24.2': optional: true + '@esbuild/android-x64@0.17.19': + optional: true + '@esbuild/android-x64@0.19.12': optional: true @@ -27205,6 +27882,9 @@ snapshots: '@esbuild/android-x64@0.24.2': optional: true + '@esbuild/darwin-arm64@0.17.19': + optional: true + '@esbuild/darwin-arm64@0.19.12': optional: true @@ -27217,6 +27897,9 @@ snapshots: '@esbuild/darwin-arm64@0.24.2': optional: true + '@esbuild/darwin-x64@0.17.19': + optional: true + '@esbuild/darwin-x64@0.19.12': optional: true @@ -27229,6 +27912,9 @@ snapshots: '@esbuild/darwin-x64@0.24.2': optional: true + '@esbuild/freebsd-arm64@0.17.19': + optional: true + '@esbuild/freebsd-arm64@0.19.12': optional: true @@ -27241,6 +27927,9 @@ snapshots: '@esbuild/freebsd-arm64@0.24.2': optional: true + '@esbuild/freebsd-x64@0.17.19': + optional: true + '@esbuild/freebsd-x64@0.19.12': optional: true @@ -27253,6 +27942,9 @@ snapshots: '@esbuild/freebsd-x64@0.24.2': optional: true + '@esbuild/linux-arm64@0.17.19': + optional: true + '@esbuild/linux-arm64@0.19.12': optional: true @@ -27265,6 +27957,9 @@ snapshots: '@esbuild/linux-arm64@0.24.2': optional: true + '@esbuild/linux-arm@0.17.19': + optional: true + '@esbuild/linux-arm@0.19.12': optional: true @@ -27277,6 +27972,9 @@ snapshots: '@esbuild/linux-arm@0.24.2': optional: true + '@esbuild/linux-ia32@0.17.19': + optional: true + '@esbuild/linux-ia32@0.19.12': optional: true @@ -27289,6 +27987,9 @@ snapshots: '@esbuild/linux-ia32@0.24.2': optional: true + '@esbuild/linux-loong64@0.17.19': + optional: true + '@esbuild/linux-loong64@0.19.12': optional: true @@ -27301,6 +28002,9 @@ snapshots: '@esbuild/linux-loong64@0.24.2': optional: true + '@esbuild/linux-mips64el@0.17.19': + optional: true + '@esbuild/linux-mips64el@0.19.12': optional: true @@ -27313,6 +28017,9 @@ snapshots: '@esbuild/linux-mips64el@0.24.2': optional: true + '@esbuild/linux-ppc64@0.17.19': + optional: true + '@esbuild/linux-ppc64@0.19.12': optional: true @@ -27325,6 +28032,9 @@ snapshots: '@esbuild/linux-ppc64@0.24.2': optional: true + '@esbuild/linux-riscv64@0.17.19': + optional: true + '@esbuild/linux-riscv64@0.19.12': optional: true @@ -27337,6 +28047,9 @@ snapshots: '@esbuild/linux-riscv64@0.24.2': optional: true + '@esbuild/linux-s390x@0.17.19': + optional: true + '@esbuild/linux-s390x@0.19.12': optional: true @@ -27349,6 +28062,9 @@ snapshots: '@esbuild/linux-s390x@0.24.2': optional: true + '@esbuild/linux-x64@0.17.19': + optional: true + '@esbuild/linux-x64@0.19.12': optional: true @@ -27364,6 +28080,9 @@ snapshots: '@esbuild/netbsd-arm64@0.24.2': optional: true + '@esbuild/netbsd-x64@0.17.19': + optional: true + '@esbuild/netbsd-x64@0.19.12': optional: true @@ -27382,6 +28101,9 @@ snapshots: '@esbuild/openbsd-arm64@0.24.2': optional: true + '@esbuild/openbsd-x64@0.17.19': + optional: true + '@esbuild/openbsd-x64@0.19.12': optional: true @@ -27394,6 +28116,9 @@ snapshots: '@esbuild/openbsd-x64@0.24.2': optional: true + '@esbuild/sunos-x64@0.17.19': + optional: true + '@esbuild/sunos-x64@0.19.12': optional: true @@ -27406,6 +28131,9 @@ snapshots: '@esbuild/sunos-x64@0.24.2': optional: true + '@esbuild/win32-arm64@0.17.19': + optional: true + '@esbuild/win32-arm64@0.19.12': optional: true @@ -27418,6 +28146,9 @@ snapshots: '@esbuild/win32-arm64@0.24.2': optional: true + '@esbuild/win32-ia32@0.17.19': + optional: true + '@esbuild/win32-ia32@0.19.12': optional: true @@ -27430,6 +28161,9 @@ snapshots: '@esbuild/win32-ia32@0.24.2': optional: true + '@esbuild/win32-x64@0.17.19': + optional: true + '@esbuild/win32-x64@0.19.12': optional: true @@ -28320,6 +29054,303 @@ snapshots: browser-headers: 0.4.1 google-protobuf: 3.21.4 + '@injectivelabs/core-proto-ts@1.13.4': + dependencies: + '@injectivelabs/grpc-web': 0.0.1(google-protobuf@3.21.4) + google-protobuf: 3.21.4 + protobufjs: 7.4.0 + rxjs: 7.8.1 + + '@injectivelabs/exceptions@1.14.33(google-protobuf@3.21.4)': + dependencies: + '@injectivelabs/grpc-web': 0.0.1(google-protobuf@3.21.4) + '@injectivelabs/ts-types': 1.14.33 + http-status-codes: 2.3.0 + shx: 0.3.4 + transitivePeerDependencies: + - google-protobuf + + '@injectivelabs/exceptions@1.14.34-beta.5(google-protobuf@3.21.4)': + dependencies: + '@injectivelabs/grpc-web': 0.0.1(google-protobuf@3.21.4) + '@injectivelabs/ts-types': 1.14.34-beta.2 + http-status-codes: 2.3.0 + shx: 0.3.4 + transitivePeerDependencies: + - google-protobuf + + '@injectivelabs/grpc-web-node-http-transport@0.0.2(@injectivelabs/grpc-web@0.0.1(google-protobuf@3.21.4))': + dependencies: + '@injectivelabs/grpc-web': 0.0.1(google-protobuf@3.21.4) + + '@injectivelabs/grpc-web-react-native-transport@0.0.2(@injectivelabs/grpc-web@0.0.1(google-protobuf@3.21.4))': + dependencies: + '@injectivelabs/grpc-web': 0.0.1(google-protobuf@3.21.4) + + '@injectivelabs/grpc-web@0.0.1(google-protobuf@3.21.4)': + dependencies: + browser-headers: 0.4.1 + google-protobuf: 3.21.4 + + '@injectivelabs/indexer-proto-ts@1.13.3': + dependencies: + '@injectivelabs/grpc-web': 0.0.1(google-protobuf@3.21.4) + google-protobuf: 3.21.4 + protobufjs: 7.4.0 + rxjs: 7.8.1 + + '@injectivelabs/injective-sdk-client-ts@file:packages/plugin-injective/injective-sdk-client-ts(@types/react@19.0.7)(bufferutil@4.0.9)(google-protobuf@3.21.4)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(utf-8-validate@6.0.5)': + dependencies: + '@injectivelabs/networks': 1.14.34-beta.2(google-protobuf@3.21.4) + '@injectivelabs/sdk-ts': 1.14.34-beta.2(@types/react@19.0.7)(bufferutil@4.0.9)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(utf-8-validate@6.0.5) + '@injectivelabs/token-metadata': 1.14.11(google-protobuf@3.21.4) + '@injectivelabs/ts-types': 1.14.34-beta.2 + '@injectivelabs/utils': 1.14.34-beta.2(google-protobuf@3.21.4) + bignumber.js: 9.1.2 + transitivePeerDependencies: + - '@types/react' + - bufferutil + - debug + - google-protobuf + - graphql-ws + - react + - react-dom + - subscriptions-transport-ws + - utf-8-validate + + '@injectivelabs/mito-proto-ts@1.13.0': + dependencies: + '@injectivelabs/grpc-web': 0.0.1(google-protobuf@3.21.4) + google-protobuf: 3.21.4 + protobufjs: 7.4.0 + rxjs: 7.8.1 + + '@injectivelabs/networks@1.14.33(google-protobuf@3.21.4)': + dependencies: + '@injectivelabs/exceptions': 1.14.33(google-protobuf@3.21.4) + '@injectivelabs/ts-types': 1.14.33 + '@injectivelabs/utils': 1.14.33(google-protobuf@3.21.4) + shx: 0.3.4 + transitivePeerDependencies: + - debug + - google-protobuf + + '@injectivelabs/networks@1.14.34-beta.2(google-protobuf@3.21.4)': + dependencies: + '@injectivelabs/exceptions': 1.14.34-beta.5(google-protobuf@3.21.4) + '@injectivelabs/ts-types': 1.14.34-beta.2 + '@injectivelabs/utils': 1.14.34-beta.2(google-protobuf@3.21.4) + shx: 0.3.4 + transitivePeerDependencies: + - debug + - google-protobuf + + '@injectivelabs/networks@1.14.34-beta.5(google-protobuf@3.21.4)': + dependencies: + '@injectivelabs/exceptions': 1.14.34-beta.5(google-protobuf@3.21.4) + '@injectivelabs/ts-types': 1.14.34-beta.2 + '@injectivelabs/utils': 1.14.34-beta.5(google-protobuf@3.21.4) + shx: 0.3.4 + transitivePeerDependencies: + - debug + - google-protobuf + + '@injectivelabs/olp-proto-ts@1.13.1': + dependencies: + '@injectivelabs/grpc-web': 0.0.1(google-protobuf@3.21.4) + google-protobuf: 3.21.4 + protobufjs: 7.4.0 + rxjs: 7.8.1 + + '@injectivelabs/sdk-ts@1.14.33(@types/react@19.0.7)(bufferutil@4.0.9)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(utf-8-validate@6.0.5)': + dependencies: + '@apollo/client': 3.12.6(@types/react@19.0.7)(graphql@16.10.0)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@cosmjs/amino': 0.32.4 + '@cosmjs/proto-signing': 0.32.4 + '@cosmjs/stargate': 0.32.4(bufferutil@4.0.9)(utf-8-validate@6.0.5) + '@ethersproject/bytes': 5.7.0 + '@injectivelabs/core-proto-ts': 1.13.4 + '@injectivelabs/exceptions': 1.14.33(google-protobuf@3.21.4) + '@injectivelabs/grpc-web': 0.0.1(google-protobuf@3.21.4) + '@injectivelabs/grpc-web-node-http-transport': 0.0.2(@injectivelabs/grpc-web@0.0.1(google-protobuf@3.21.4)) + '@injectivelabs/grpc-web-react-native-transport': 0.0.2(@injectivelabs/grpc-web@0.0.1(google-protobuf@3.21.4)) + '@injectivelabs/indexer-proto-ts': 1.13.3 + '@injectivelabs/mito-proto-ts': 1.13.0 + '@injectivelabs/networks': 1.14.33(google-protobuf@3.21.4) + '@injectivelabs/olp-proto-ts': 1.13.1 + '@injectivelabs/test-utils': 1.14.33(google-protobuf@3.21.4) + '@injectivelabs/ts-types': 1.14.33 + '@injectivelabs/utils': 1.14.33(google-protobuf@3.21.4) + '@metamask/eth-sig-util': 4.0.1 + '@noble/curves': 1.8.0 + axios: 1.7.9(debug@4.4.0) + bech32: 2.0.0 + bip39: 3.1.0 + cosmjs-types: 0.9.0 + ethereumjs-util: 7.1.5 + ethers: 6.13.4(bufferutil@4.0.9)(utf-8-validate@6.0.5) + google-protobuf: 3.21.4 + graphql: 16.10.0 + http-status-codes: 2.3.0 + js-sha3: 0.8.0 + jscrypto: 1.0.3 + keccak256: 1.0.6 + secp256k1: 4.0.4 + shx: 0.3.4 + snakecase-keys: 5.5.0 + transitivePeerDependencies: + - '@types/react' + - bufferutil + - debug + - graphql-ws + - react + - react-dom + - subscriptions-transport-ws + - utf-8-validate + + '@injectivelabs/sdk-ts@1.14.34-beta.2(@types/react@19.0.7)(bufferutil@4.0.9)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(utf-8-validate@6.0.5)': + dependencies: + '@apollo/client': 3.12.6(@types/react@19.0.7)(graphql@16.10.0)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@cosmjs/amino': 0.32.4 + '@cosmjs/proto-signing': 0.32.4 + '@cosmjs/stargate': 0.32.4(bufferutil@4.0.9)(utf-8-validate@6.0.5) + '@ethersproject/bytes': 5.7.0 + '@injectivelabs/core-proto-ts': 1.13.4 + '@injectivelabs/exceptions': 1.14.33(google-protobuf@3.21.4) + '@injectivelabs/grpc-web': 0.0.1(google-protobuf@3.21.4) + '@injectivelabs/grpc-web-node-http-transport': 0.0.2(@injectivelabs/grpc-web@0.0.1(google-protobuf@3.21.4)) + '@injectivelabs/grpc-web-react-native-transport': 0.0.2(@injectivelabs/grpc-web@0.0.1(google-protobuf@3.21.4)) + '@injectivelabs/indexer-proto-ts': 1.13.3 + '@injectivelabs/mito-proto-ts': 1.13.0 + '@injectivelabs/networks': 1.14.33(google-protobuf@3.21.4) + '@injectivelabs/olp-proto-ts': 1.13.1 + '@injectivelabs/test-utils': 1.14.34-beta.8(google-protobuf@3.21.4) + '@injectivelabs/ts-types': 1.14.33 + '@injectivelabs/utils': 1.14.33(google-protobuf@3.21.4) + '@metamask/eth-sig-util': 4.0.1 + '@noble/curves': 1.8.0 + axios: 1.7.9(debug@4.4.0) + bech32: 2.0.0 + bip39: 3.1.0 + cosmjs-types: 0.9.0 + ethereumjs-util: 7.1.5 + ethers: 6.13.4(bufferutil@4.0.9)(utf-8-validate@6.0.5) + google-protobuf: 3.21.4 + graphql: 16.10.0 + http-status-codes: 2.3.0 + js-sha3: 0.8.0 + jscrypto: 1.0.3 + keccak256: 1.0.6 + secp256k1: 4.0.4 + shx: 0.3.4 + snakecase-keys: 5.5.0 + transitivePeerDependencies: + - '@types/react' + - bufferutil + - debug + - graphql-ws + - react + - react-dom + - subscriptions-transport-ws + - utf-8-validate + + '@injectivelabs/test-utils@1.14.33(google-protobuf@3.21.4)': + dependencies: + '@injectivelabs/exceptions': 1.14.33(google-protobuf@3.21.4) + '@injectivelabs/networks': 1.14.33(google-protobuf@3.21.4) + '@injectivelabs/ts-types': 1.14.33 + '@injectivelabs/utils': 1.14.33(google-protobuf@3.21.4) + axios: 1.7.9(debug@4.4.0) + bignumber.js: 9.1.2 + shx: 0.3.4 + snakecase-keys: 5.5.0 + store2: 2.14.4 + transitivePeerDependencies: + - debug + - google-protobuf + + '@injectivelabs/test-utils@1.14.34-beta.8(google-protobuf@3.21.4)': + dependencies: + '@injectivelabs/exceptions': 1.14.34-beta.5(google-protobuf@3.21.4) + '@injectivelabs/networks': 1.14.34-beta.5(google-protobuf@3.21.4) + '@injectivelabs/ts-types': 1.14.34-beta.2 + '@injectivelabs/utils': 1.14.34-beta.5(google-protobuf@3.21.4) + axios: 1.7.9(debug@4.4.0) + bignumber.js: 9.1.2 + shx: 0.3.4 + snakecase-keys: 5.5.0 + store2: 2.14.4 + transitivePeerDependencies: + - debug + - google-protobuf + + '@injectivelabs/token-metadata@1.14.11(google-protobuf@3.21.4)': + dependencies: + '@injectivelabs/exceptions': 1.14.33(google-protobuf@3.21.4) + '@injectivelabs/networks': 1.14.33(google-protobuf@3.21.4) + '@injectivelabs/ts-types': 1.14.33 + '@injectivelabs/utils': 1.14.33(google-protobuf@3.21.4) + '@types/lodash.values': 4.3.9 + copyfiles: 2.4.1 + jsonschema: 1.5.0 + link-module-alias: 1.2.0 + lodash: 4.17.21 + lodash.values: 4.3.0 + shx: 0.3.4 + transitivePeerDependencies: + - debug + - google-protobuf + + '@injectivelabs/ts-types@1.14.33': + dependencies: + shx: 0.3.4 + + '@injectivelabs/ts-types@1.14.34-beta.2': + dependencies: + shx: 0.3.4 + + '@injectivelabs/utils@1.14.33(google-protobuf@3.21.4)': + dependencies: + '@injectivelabs/exceptions': 1.14.33(google-protobuf@3.21.4) + '@injectivelabs/ts-types': 1.14.33 + axios: 1.7.9(debug@4.4.0) + bignumber.js: 9.1.2 + http-status-codes: 2.3.0 + shx: 0.3.4 + snakecase-keys: 5.5.0 + store2: 2.14.4 + transitivePeerDependencies: + - debug + - google-protobuf + + '@injectivelabs/utils@1.14.34-beta.2(google-protobuf@3.21.4)': + dependencies: + '@injectivelabs/exceptions': 1.14.34-beta.5(google-protobuf@3.21.4) + '@injectivelabs/ts-types': 1.14.34-beta.2 + axios: 1.7.9(debug@4.4.0) + bignumber.js: 9.1.2 + http-status-codes: 2.3.0 + shx: 0.3.4 + snakecase-keys: 5.5.0 + store2: 2.14.4 + transitivePeerDependencies: + - debug + - google-protobuf + + '@injectivelabs/utils@1.14.34-beta.5(google-protobuf@3.21.4)': + dependencies: + '@injectivelabs/exceptions': 1.14.34-beta.5(google-protobuf@3.21.4) + '@injectivelabs/ts-types': 1.14.34-beta.2 + axios: 1.7.9(debug@4.4.0) + bignumber.js: 9.1.2 + http-status-codes: 2.3.0 + shx: 0.3.4 + snakecase-keys: 5.5.0 + store2: 2.14.4 + transitivePeerDependencies: + - debug + - google-protobuf + '@ioredis/commands@1.2.0': {} '@irys/arweave@0.0.2': @@ -28490,62 +29521,27 @@ snapshots: '@jest/console@29.7.0': dependencies: '@jest/types': 29.6.3 - '@types/node': 20.17.9 - chalk: 4.1.2 - jest-message-util: 29.7.0 - jest-util: 29.7.0 - slash: 3.0.0 - - '@jest/core@29.7.0(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@18.19.71)(typescript@5.6.3))': - dependencies: - '@jest/console': 29.7.0 - '@jest/reporters': 29.7.0 - '@jest/test-result': 29.7.0 - '@jest/transform': 29.7.0 - '@jest/types': 29.6.3 - '@types/node': 20.17.9 - ansi-escapes: 4.3.2 + '@types/node': 22.10.7 chalk: 4.1.2 - ci-info: 3.9.0 - exit: 0.1.2 - graceful-fs: 4.2.11 - jest-changed-files: 29.7.0 - jest-config: 29.7.0(@types/node@20.17.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@18.19.71)(typescript@5.6.3)) - jest-haste-map: 29.7.0 jest-message-util: 29.7.0 - jest-regex-util: 29.6.3 - jest-resolve: 29.7.0 - jest-resolve-dependencies: 29.7.0 - jest-runner: 29.7.0 - jest-runtime: 29.7.0 - jest-snapshot: 29.7.0 jest-util: 29.7.0 - jest-validate: 29.7.0 - jest-watcher: 29.7.0 - micromatch: 4.0.8 - pretty-format: 29.7.0 slash: 3.0.0 - strip-ansi: 6.0.1 - transitivePeerDependencies: - - babel-plugin-macros - - supports-color - - ts-node - '@jest/core@29.7.0(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@20.17.9)(typescript@5.7.3))': + '@jest/core@29.7.0(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@22.10.7)(typescript@5.7.3))': dependencies: '@jest/console': 29.7.0 '@jest/reporters': 29.7.0 '@jest/test-result': 29.7.0 '@jest/transform': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 20.17.9 + '@types/node': 22.10.7 ansi-escapes: 4.3.2 chalk: 4.1.2 ci-info: 3.9.0 exit: 0.1.2 graceful-fs: 4.2.11 jest-changed-files: 29.7.0 - jest-config: 29.7.0(@types/node@20.17.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@20.17.9)(typescript@5.7.3)) + jest-config: 29.7.0(@types/node@22.10.7)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@22.10.7)(typescript@5.7.3)) jest-haste-map: 29.7.0 jest-message-util: 29.7.0 jest-regex-util: 29.6.3 @@ -28573,14 +29569,14 @@ snapshots: '@jest/test-result': 29.7.0 '@jest/transform': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 20.17.9 + '@types/node': 22.10.7 ansi-escapes: 4.3.2 chalk: 4.1.2 ci-info: 3.9.0 exit: 0.1.2 graceful-fs: 4.2.11 jest-changed-files: 29.7.0 - jest-config: 29.7.0(@types/node@20.17.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@22.8.4)(typescript@5.6.3)) + jest-config: 29.7.0(@types/node@22.10.7)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@22.8.4)(typescript@5.6.3)) jest-haste-map: 29.7.0 jest-message-util: 29.7.0 jest-regex-util: 29.6.3 @@ -28605,7 +29601,7 @@ snapshots: dependencies: '@jest/fake-timers': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 20.17.9 + '@types/node': 22.10.7 jest-mock: 29.7.0 '@jest/expect-utils@29.7.0': @@ -28623,7 +29619,7 @@ snapshots: dependencies: '@jest/types': 29.6.3 '@sinonjs/fake-timers': 10.3.0 - '@types/node': 20.17.9 + '@types/node': 22.10.7 jest-message-util: 29.7.0 jest-mock: 29.7.0 jest-util: 29.7.0 @@ -28645,7 +29641,7 @@ snapshots: '@jest/transform': 29.7.0 '@jest/types': 29.6.3 '@jridgewell/trace-mapping': 0.3.25 - '@types/node': 20.17.9 + '@types/node': 22.10.7 chalk: 4.1.2 collect-v8-coverage: 1.0.2 exit: 0.1.2 @@ -28715,7 +29711,7 @@ snapshots: '@jest/schemas': 29.6.3 '@types/istanbul-lib-coverage': 2.0.6 '@types/istanbul-reports': 3.0.4 - '@types/node': 20.17.9 + '@types/node': 22.10.7 '@types/yargs': 17.0.33 chalk: 4.1.2 @@ -28892,7 +29888,7 @@ snapshots: - utf-8-validate - wait-for-expect - '@lens-protocol/client@2.2.0(@jest/globals@29.7.0)(@lens-protocol/metadata@1.2.0(zod@3.23.8))(bufferutil@4.0.9)(encoding@0.1.13)(ethers@6.13.4(bufferutil@4.0.9)(utf-8-validate@5.0.10))(utf-8-validate@5.0.10)': + '@lens-protocol/client@2.2.0(@jest/globals@29.7.0)(@lens-protocol/metadata@1.2.0(zod@3.23.8))(@types/react@19.0.7)(bufferutil@4.0.9)(encoding@0.1.13)(ethers@6.13.4(bufferutil@4.0.9)(utf-8-validate@5.0.10))(react@19.0.0)(utf-8-validate@5.0.10)': dependencies: '@ethersproject/abi': 5.7.0 '@ethersproject/abstract-signer': 5.7.0 @@ -28903,7 +29899,7 @@ snapshots: '@ethersproject/providers': 5.7.2(bufferutil@4.0.9)(utf-8-validate@5.0.10) '@ethersproject/wallet': 5.7.0 '@lens-protocol/blockchain-bindings': 0.10.2(@jest/globals@29.7.0)(bufferutil@4.0.9)(utf-8-validate@5.0.10) - '@lens-protocol/gated-content': 0.5.1(@ethersproject/abi@5.7.0)(@ethersproject/address@5.7.0)(@ethersproject/bignumber@5.7.0)(@ethersproject/contracts@5.7.0)(@ethersproject/hash@5.7.0)(@ethersproject/providers@5.7.2(bufferutil@4.0.9)(utf-8-validate@5.0.10))(@ethersproject/wallet@5.7.0)(@lens-protocol/metadata@1.2.0(zod@3.23.8))(bufferutil@4.0.9)(encoding@0.1.13)(ethers@6.13.4(bufferutil@4.0.9)(utf-8-validate@5.0.10))(utf-8-validate@5.0.10)(zod@3.23.8) + '@lens-protocol/gated-content': 0.5.1(@ethersproject/abi@5.7.0)(@ethersproject/address@5.7.0)(@ethersproject/bignumber@5.7.0)(@ethersproject/contracts@5.7.0)(@ethersproject/hash@5.7.0)(@ethersproject/providers@5.7.2(bufferutil@4.0.9)(utf-8-validate@5.0.10))(@ethersproject/wallet@5.7.0)(@lens-protocol/metadata@1.2.0(zod@3.23.8))(@types/react@19.0.7)(bufferutil@4.0.9)(encoding@0.1.13)(ethers@6.13.4(bufferutil@4.0.9)(utf-8-validate@5.0.10))(react@19.0.0)(utf-8-validate@5.0.10)(zod@3.23.8) '@lens-protocol/shared-kernel': 0.12.0 '@lens-protocol/storage': 0.8.1 graphql: 16.10.0 @@ -28952,7 +29948,7 @@ snapshots: optionalDependencies: '@jest/globals': 29.7.0 - '@lens-protocol/gated-content@0.5.1(@ethersproject/abi@5.7.0)(@ethersproject/address@5.7.0)(@ethersproject/bignumber@5.7.0)(@ethersproject/contracts@5.7.0)(@ethersproject/hash@5.7.0)(@ethersproject/providers@5.7.2(bufferutil@4.0.9)(utf-8-validate@5.0.10))(@ethersproject/wallet@5.7.0)(@lens-protocol/metadata@1.2.0(zod@3.23.8))(bufferutil@4.0.9)(encoding@0.1.13)(ethers@6.13.4(bufferutil@4.0.9)(utf-8-validate@5.0.10))(utf-8-validate@5.0.10)(zod@3.23.8)': + '@lens-protocol/gated-content@0.5.1(@ethersproject/abi@5.7.0)(@ethersproject/address@5.7.0)(@ethersproject/bignumber@5.7.0)(@ethersproject/contracts@5.7.0)(@ethersproject/hash@5.7.0)(@ethersproject/providers@5.7.2(bufferutil@4.0.9)(utf-8-validate@5.0.10))(@ethersproject/wallet@5.7.0)(@lens-protocol/metadata@1.2.0(zod@3.23.8))(@types/react@19.0.7)(bufferutil@4.0.9)(encoding@0.1.13)(ethers@6.13.4(bufferutil@4.0.9)(utf-8-validate@5.0.10))(react@19.0.0)(utf-8-validate@5.0.10)(zod@3.23.8)': dependencies: '@ethersproject/abi': 5.7.0 '@ethersproject/address': 5.7.0 @@ -28967,7 +29963,7 @@ snapshots: '@lit-protocol/constants': 2.1.62 '@lit-protocol/crypto': 2.1.62(bufferutil@4.0.9)(utf-8-validate@5.0.10) '@lit-protocol/encryption': 2.1.62(bufferutil@4.0.9)(utf-8-validate@5.0.10) - '@lit-protocol/node-client': 2.1.62(@ethersproject/contracts@5.7.0)(@ethersproject/hash@5.7.0)(@ethersproject/providers@5.7.2(bufferutil@4.0.9)(utf-8-validate@5.0.10))(@ethersproject/wallet@5.7.0)(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10) + '@lit-protocol/node-client': 2.1.62(@ethersproject/contracts@5.7.0)(@ethersproject/hash@5.7.0)(@ethersproject/providers@5.7.2(bufferutil@4.0.9)(utf-8-validate@5.0.10))(@ethersproject/wallet@5.7.0)(@types/react@19.0.7)(bufferutil@4.0.9)(encoding@0.1.13)(react@19.0.0)(utf-8-validate@5.0.10) '@lit-protocol/types': 2.1.62 siwe: 2.3.2(ethers@6.13.4(bufferutil@4.0.9)(utf-8-validate@5.0.10)) tslib: 2.8.1 @@ -29165,14 +30161,14 @@ snapshots: - bufferutil - utf-8-validate - '@lit-protocol/auth-browser@2.1.62(@ethersproject/contracts@5.7.0)(@ethersproject/hash@5.7.0)(@ethersproject/providers@5.7.2(bufferutil@4.0.9)(utf-8-validate@5.0.10))(@ethersproject/wallet@5.7.0)(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10)': + '@lit-protocol/auth-browser@2.1.62(@ethersproject/contracts@5.7.0)(@ethersproject/hash@5.7.0)(@ethersproject/providers@5.7.2(bufferutil@4.0.9)(utf-8-validate@5.0.10))(@ethersproject/wallet@5.7.0)(@types/react@19.0.7)(bufferutil@4.0.9)(encoding@0.1.13)(react@19.0.0)(utf-8-validate@5.0.10)': dependencies: '@lit-protocol/constants': 2.1.62 '@lit-protocol/misc': 2.1.62 '@lit-protocol/misc-browser': 2.1.62(bufferutil@4.0.9)(utf-8-validate@5.0.10) '@lit-protocol/types': 2.1.62 '@lit-protocol/uint8arrays': 2.1.62 - '@walletconnect/ethereum-provider': 2.17.3(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10) + '@walletconnect/ethereum-provider': 2.17.3(@types/react@19.0.7)(bufferutil@4.0.9)(encoding@0.1.13)(react@19.0.0)(utf-8-validate@5.0.10) ethers: 5.7.2(bufferutil@4.0.9)(utf-8-validate@5.0.10) lit-connect-modal: 0.1.11 lit-siwe: 1.1.8(@ethersproject/contracts@5.7.0)(@ethersproject/hash@5.7.0)(@ethersproject/providers@5.7.2(bufferutil@4.0.9)(utf-8-validate@5.0.10))(@ethersproject/wallet@5.7.0) @@ -29273,10 +30269,10 @@ snapshots: '@lit-protocol/nacl@2.1.62': {} - '@lit-protocol/node-client@2.1.62(@ethersproject/contracts@5.7.0)(@ethersproject/hash@5.7.0)(@ethersproject/providers@5.7.2(bufferutil@4.0.9)(utf-8-validate@5.0.10))(@ethersproject/wallet@5.7.0)(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10)': + '@lit-protocol/node-client@2.1.62(@ethersproject/contracts@5.7.0)(@ethersproject/hash@5.7.0)(@ethersproject/providers@5.7.2(bufferutil@4.0.9)(utf-8-validate@5.0.10))(@ethersproject/wallet@5.7.0)(@types/react@19.0.7)(bufferutil@4.0.9)(encoding@0.1.13)(react@19.0.0)(utf-8-validate@5.0.10)': dependencies: '@lit-protocol/access-control-conditions': 2.1.62(bufferutil@4.0.9)(utf-8-validate@5.0.10) - '@lit-protocol/auth-browser': 2.1.62(@ethersproject/contracts@5.7.0)(@ethersproject/hash@5.7.0)(@ethersproject/providers@5.7.2(bufferutil@4.0.9)(utf-8-validate@5.0.10))(@ethersproject/wallet@5.7.0)(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10) + '@lit-protocol/auth-browser': 2.1.62(@ethersproject/contracts@5.7.0)(@ethersproject/hash@5.7.0)(@ethersproject/providers@5.7.2(bufferutil@4.0.9)(utf-8-validate@5.0.10))(@ethersproject/wallet@5.7.0)(@types/react@19.0.7)(bufferutil@4.0.9)(encoding@0.1.13)(react@19.0.0)(utf-8-validate@5.0.10) '@lit-protocol/bls-sdk': 2.1.62 '@lit-protocol/constants': 2.1.62 '@lit-protocol/crypto': 2.1.62(bufferutil@4.0.9)(utf-8-validate@5.0.10) @@ -29288,7 +30284,7 @@ snapshots: '@lit-protocol/nacl': 2.1.62 '@lit-protocol/types': 2.1.62 '@lit-protocol/uint8arrays': 2.1.62 - '@walletconnect/ethereum-provider': 2.17.3(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10) + '@walletconnect/ethereum-provider': 2.17.3(@types/react@19.0.7)(bufferutil@4.0.9)(encoding@0.1.13)(react@19.0.0)(utf-8-validate@5.0.10) ethers: 5.7.2(bufferutil@4.0.9)(utf-8-validate@5.0.10) jszip: 3.10.1 lit-connect-modal: 0.1.11 @@ -29408,6 +30404,14 @@ snapshots: dependencies: langium: 3.0.0 + '@metamask/eth-sig-util@4.0.1': + dependencies: + ethereumjs-abi: 0.6.8 + ethereumjs-util: 6.2.1 + ethjs-util: 0.1.6 + tweetnacl: 1.0.3 + tweetnacl-util: 0.15.1 + '@metaplex-foundation/beet-solana@0.3.1(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10)': dependencies: '@metaplex-foundation/beet': 0.7.2 @@ -32433,6 +33437,18 @@ snapshots: dependencies: '@sinonjs/commons': 3.0.1 + '@sinonjs/fake-timers@13.0.5': + dependencies: + '@sinonjs/commons': 3.0.1 + + '@sinonjs/samsam@8.0.2': + dependencies: + '@sinonjs/commons': 3.0.1 + lodash.get: 4.4.2 + type-detect: 4.1.0 + + '@sinonjs/text-encoding@0.7.3': {} + '@slack/events-api@3.0.1': dependencies: '@types/debug': 4.1.12 @@ -32452,7 +33468,7 @@ snapshots: '@slack/logger@3.0.0': dependencies: - '@types/node': 20.17.9 + '@types/node': 22.10.7 '@slack/types@2.14.0': {} @@ -33964,9 +34980,13 @@ snapshots: '@types/bluebird@3.5.42': {} + '@types/bn.js@4.11.6': + dependencies: + '@types/node': 22.10.7 + '@types/bn.js@5.1.6': dependencies: - '@types/node': 20.17.9 + '@types/node': 22.10.7 '@types/body-parser@1.19.5': dependencies: @@ -33975,23 +34995,27 @@ snapshots: '@types/bonjour@3.5.13': dependencies: - '@types/node': 20.17.9 + '@types/node': 22.10.7 '@types/cacheable-request@6.0.3': dependencies: '@types/http-cache-semantics': 4.0.4 '@types/keyv': 3.1.4 - '@types/node': 20.17.9 + '@types/node': 22.10.7 '@types/responselike': 1.0.3 '@types/caseless@0.12.5': {} '@types/chai-subset@1.3.5': dependencies: - '@types/chai': 4.3.20 + '@types/chai': 5.0.1 '@types/chai@4.3.20': {} + '@types/chai@5.0.1': + dependencies: + '@types/deep-eql': 4.0.2 + '@types/chance@1.1.6': {} '@types/chrome@0.0.278': @@ -34002,11 +35026,11 @@ snapshots: '@types/connect-history-api-fallback@1.5.4': dependencies: '@types/express-serve-static-core': 5.0.5 - '@types/node': 20.17.9 + '@types/node': 22.10.7 '@types/connect@3.4.38': dependencies: - '@types/node': 20.17.9 + '@types/node': 22.10.7 '@types/cookie@0.6.0': {} @@ -34135,6 +35159,8 @@ snapshots: dependencies: '@types/ms': 0.7.34 + '@types/deep-eql@4.0.2': {} + '@types/diff-match-patch@1.0.36': {} '@types/dompurify@3.2.0': @@ -34169,14 +35195,14 @@ snapshots: '@types/express-serve-static-core@4.19.6': dependencies: - '@types/node': 20.17.9 + '@types/node': 22.10.7 '@types/qs': 6.9.18 '@types/range-parser': 1.2.7 '@types/send': 0.17.4 '@types/express-serve-static-core@5.0.5': dependencies: - '@types/node': 20.17.9 + '@types/node': 22.10.7 '@types/qs': 6.9.18 '@types/range-parser': 1.2.7 '@types/send': 0.17.4 @@ -34216,7 +35242,7 @@ snapshots: '@types/graceful-fs@4.1.9': dependencies: - '@types/node': 20.17.9 + '@types/node': 22.10.7 '@types/gtag.js@0.0.12': {} @@ -34240,7 +35266,7 @@ snapshots: '@types/http-proxy@1.17.15': dependencies: - '@types/node': 20.17.9 + '@types/node': 22.10.7 '@types/ioredis@5.0.0': dependencies: @@ -34250,7 +35276,7 @@ snapshots: '@types/is-stream@1.1.0': dependencies: - '@types/node': 20.17.9 + '@types/node': 22.10.7 '@types/istanbul-lib-coverage@2.0.6': {} @@ -34279,12 +35305,16 @@ snapshots: '@types/keyv@3.1.4': dependencies: - '@types/node': 20.17.9 + '@types/node': 22.10.7 '@types/lodash.isstring@4.0.9': dependencies: '@types/lodash': 4.17.14 + '@types/lodash.values@4.3.9': + dependencies: + '@types/lodash': 4.17.14 + '@types/lodash@4.17.14': {} '@types/long@4.0.2': {} @@ -34313,12 +35343,12 @@ snapshots: '@types/node-fetch@2.6.12': dependencies: - '@types/node': 20.17.9 + '@types/node': 22.10.7 form-data: 4.0.1 '@types/node-forge@1.3.11': dependencies: - '@types/node': 20.17.9 + '@types/node': 22.10.7 '@types/node@10.17.60': {} @@ -34356,6 +35386,10 @@ snapshots: '@types/parse5@5.0.3': {} + '@types/pbkdf2@3.1.2': + dependencies: + '@types/node': 22.10.7 + '@types/pdfjs-dist@2.10.378(encoding@0.1.13)': dependencies: pdfjs-dist: 4.7.76(encoding@0.1.13) @@ -34414,7 +35448,7 @@ snapshots: '@types/request@2.48.12': dependencies: '@types/caseless': 0.12.5 - '@types/node': 20.17.9 + '@types/node': 22.10.7 '@types/tough-cookie': 4.0.5 form-data: 2.5.2 @@ -34422,7 +35456,7 @@ snapshots: '@types/responselike@1.0.3': dependencies: - '@types/node': 20.17.9 + '@types/node': 22.10.7 '@types/retry@0.12.0': {} @@ -34430,14 +35464,18 @@ snapshots: '@types/sax@1.2.7': dependencies: - '@types/node': 20.17.9 + '@types/node': 22.10.7 + + '@types/secp256k1@4.0.6': + dependencies: + '@types/node': 22.10.7 '@types/semver@7.5.8': {} '@types/send@0.17.4': dependencies: '@types/mime': 1.3.5 - '@types/node': 20.17.9 + '@types/node': 22.10.7 '@types/serve-index@1.9.4': dependencies: @@ -34446,16 +35484,22 @@ snapshots: '@types/serve-static@1.15.7': dependencies: '@types/http-errors': 2.0.4 - '@types/node': 20.17.9 + '@types/node': 22.10.7 '@types/send': 0.17.4 '@types/sharp@0.32.0': dependencies: sharp: 0.33.5 + '@types/sinon@17.0.3': + dependencies: + '@types/sinonjs__fake-timers': 8.1.5 + + '@types/sinonjs__fake-timers@8.1.5': {} + '@types/sockjs@0.3.36': dependencies: - '@types/node': 20.17.9 + '@types/node': 22.10.7 '@types/sql.js@1.4.9': dependencies: @@ -34479,7 +35523,7 @@ snapshots: '@types/unzipper@0.10.10': dependencies: - '@types/node': 20.17.9 + '@types/node': 22.10.7 '@types/uuid@10.0.0': {} @@ -34491,7 +35535,7 @@ snapshots: '@types/ws@7.4.7': dependencies: - '@types/node': 20.17.9 + '@types/node': 22.10.7 '@types/ws@8.5.13': dependencies: @@ -34499,7 +35543,7 @@ snapshots: '@types/ws@8.5.3': dependencies: - '@types/node': 20.17.9 + '@types/node': 22.10.7 '@types/yargs-parser@21.0.3': {} @@ -34513,7 +35557,7 @@ snapshots: '@types/yauzl@2.10.3': dependencies: - '@types/node': 20.17.9 + '@types/node': 22.10.7 optional: true '@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@9.18.0(jiti@2.4.2))(typescript@5.6.3))(eslint@9.18.0(jiti@2.4.2))(typescript@5.6.3)': @@ -34554,6 +35598,24 @@ snapshots: transitivePeerDependencies: - supports-color + '@typescript-eslint/eslint-plugin@8.16.0(@typescript-eslint/parser@8.16.0(eslint@9.16.0(jiti@2.4.2))(typescript@5.7.3))(eslint@9.16.0(jiti@2.4.2))(typescript@5.7.3)': + dependencies: + '@eslint-community/regexpp': 4.12.1 + '@typescript-eslint/parser': 8.16.0(eslint@9.16.0(jiti@2.4.2))(typescript@5.7.3) + '@typescript-eslint/scope-manager': 8.16.0 + '@typescript-eslint/type-utils': 8.16.0(eslint@9.16.0(jiti@2.4.2))(typescript@5.7.3) + '@typescript-eslint/utils': 8.16.0(eslint@9.16.0(jiti@2.4.2))(typescript@5.7.3) + '@typescript-eslint/visitor-keys': 8.16.0 + eslint: 9.16.0(jiti@2.4.2) + graphemer: 1.4.0 + ignore: 5.3.2 + natural-compare: 1.4.0 + ts-api-utils: 1.4.3(typescript@5.7.3) + optionalDependencies: + typescript: 5.7.3 + transitivePeerDependencies: + - supports-color + '@typescript-eslint/eslint-plugin@8.16.0(@typescript-eslint/parser@8.16.0(eslint@9.18.0(jiti@2.4.2))(typescript@5.6.3))(eslint@9.18.0(jiti@2.4.2))(typescript@5.6.3)': dependencies: '@eslint-community/regexpp': 4.12.1 @@ -34615,6 +35677,19 @@ snapshots: transitivePeerDependencies: - supports-color + '@typescript-eslint/parser@8.16.0(eslint@9.16.0(jiti@2.4.2))(typescript@5.7.3)': + dependencies: + '@typescript-eslint/scope-manager': 8.16.0 + '@typescript-eslint/types': 8.16.0 + '@typescript-eslint/typescript-estree': 8.16.0(typescript@5.7.3) + '@typescript-eslint/visitor-keys': 8.16.0 + debug: 4.4.0(supports-color@5.5.0) + eslint: 9.16.0(jiti@2.4.2) + optionalDependencies: + typescript: 5.7.3 + transitivePeerDependencies: + - supports-color + '@typescript-eslint/parser@8.16.0(eslint@9.18.0(jiti@2.4.2))(typescript@5.6.3)': dependencies: '@typescript-eslint/scope-manager': 8.16.0 @@ -34679,6 +35754,18 @@ snapshots: transitivePeerDependencies: - supports-color + '@typescript-eslint/type-utils@8.16.0(eslint@9.16.0(jiti@2.4.2))(typescript@5.7.3)': + dependencies: + '@typescript-eslint/typescript-estree': 8.16.0(typescript@5.7.3) + '@typescript-eslint/utils': 8.16.0(eslint@9.16.0(jiti@2.4.2))(typescript@5.7.3) + debug: 4.4.0(supports-color@5.5.0) + eslint: 9.16.0(jiti@2.4.2) + ts-api-utils: 1.4.3(typescript@5.7.3) + optionalDependencies: + typescript: 5.7.3 + transitivePeerDependencies: + - supports-color + '@typescript-eslint/type-utils@8.16.0(eslint@9.18.0(jiti@2.4.2))(typescript@5.6.3)': dependencies: '@typescript-eslint/typescript-estree': 8.16.0(typescript@5.6.3) @@ -34738,6 +35825,21 @@ snapshots: transitivePeerDependencies: - supports-color + '@typescript-eslint/typescript-estree@8.16.0(typescript@5.7.3)': + dependencies: + '@typescript-eslint/types': 8.16.0 + '@typescript-eslint/visitor-keys': 8.16.0 + debug: 4.4.0(supports-color@5.5.0) + fast-glob: 3.3.3 + is-glob: 4.0.3 + minimatch: 9.0.5 + semver: 7.6.3 + ts-api-utils: 1.4.3(typescript@5.7.3) + optionalDependencies: + typescript: 5.7.3 + transitivePeerDependencies: + - supports-color + '@typescript-eslint/typescript-estree@8.20.0(typescript@5.6.3)': dependencies: '@typescript-eslint/types': 8.20.0 @@ -34778,6 +35880,18 @@ snapshots: transitivePeerDependencies: - supports-color + '@typescript-eslint/utils@8.16.0(eslint@9.16.0(jiti@2.4.2))(typescript@5.7.3)': + dependencies: + '@eslint-community/eslint-utils': 4.4.1(eslint@9.16.0(jiti@2.4.2)) + '@typescript-eslint/scope-manager': 8.16.0 + '@typescript-eslint/types': 8.16.0 + '@typescript-eslint/typescript-estree': 8.16.0(typescript@5.7.3) + eslint: 9.16.0(jiti@2.4.2) + optionalDependencies: + typescript: 5.7.3 + transitivePeerDependencies: + - supports-color + '@typescript-eslint/utils@8.16.0(eslint@9.18.0(jiti@2.4.2))(typescript@5.6.3)': dependencies: '@eslint-community/eslint-utils': 4.4.1(eslint@9.18.0(jiti@2.4.2)) @@ -35298,6 +36412,47 @@ snapshots: - uploadthing - utf-8-validate + '@walletconnect/core@2.17.3(bufferutil@4.0.9)(utf-8-validate@5.0.10)': + dependencies: + '@walletconnect/heartbeat': 1.2.2 + '@walletconnect/jsonrpc-provider': 1.0.14 + '@walletconnect/jsonrpc-types': 1.0.4 + '@walletconnect/jsonrpc-utils': 1.0.8 + '@walletconnect/jsonrpc-ws-connection': 1.0.16(bufferutil@4.0.9)(utf-8-validate@5.0.10) + '@walletconnect/keyvaluestorage': 1.1.1(ioredis@5.4.2) + '@walletconnect/logger': 2.1.2 + '@walletconnect/relay-api': 1.0.11 + '@walletconnect/relay-auth': 1.0.4 + '@walletconnect/safe-json': 1.0.2 + '@walletconnect/time': 1.0.2 + '@walletconnect/types': 2.17.3(ioredis@5.4.2) + '@walletconnect/utils': 2.17.3(ioredis@5.4.2) + '@walletconnect/window-getters': 1.0.1 + events: 3.3.0 + lodash.isequal: 4.5.0 + uint8arrays: 3.1.0 + transitivePeerDependencies: + - '@azure/app-configuration' + - '@azure/cosmos' + - '@azure/data-tables' + - '@azure/identity' + - '@azure/keyvault-secrets' + - '@azure/storage-blob' + - '@capacitor/preferences' + - '@deno/kv' + - '@netlify/blobs' + - '@planetscale/database' + - '@react-native-async-storage/async-storage' + - '@upstash/redis' + - '@vercel/blob' + - '@vercel/kv' + - aws4fetch + - bufferutil + - db0 + - ioredis + - uploadthing + - utf-8-validate + '@walletconnect/environment@1.0.1': dependencies: tslib: 1.14.1 @@ -35340,7 +36495,7 @@ snapshots: - uploadthing - utf-8-validate - '@walletconnect/ethereum-provider@2.17.3(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10)': + '@walletconnect/ethereum-provider@2.17.3(@types/react@19.0.7)(bufferutil@4.0.9)(encoding@0.1.13)(react@19.0.0)(utf-8-validate@5.0.10)': dependencies: '@walletconnect/jsonrpc-http-connection': 1.0.8(encoding@0.1.13) '@walletconnect/jsonrpc-provider': 1.0.14 @@ -35574,7 +36729,7 @@ snapshots: '@walletconnect/sign-client@2.17.3(bufferutil@4.0.9)(utf-8-validate@5.0.10)': dependencies: - '@walletconnect/core': 2.17.3(bufferutil@4.0.9)(ioredis@5.4.2)(utf-8-validate@5.0.10) + '@walletconnect/core': 2.17.3(bufferutil@4.0.9)(utf-8-validate@5.0.10) '@walletconnect/events': 1.0.1 '@walletconnect/heartbeat': 1.2.2 '@walletconnect/jsonrpc-utils': 1.0.8 @@ -35838,6 +36993,22 @@ snapshots: '@webassemblyjs/ast': 1.14.1 '@xtuc/long': 4.2.2 + '@wry/caches@1.0.1': + dependencies: + tslib: 2.8.1 + + '@wry/context@0.7.4': + dependencies: + tslib: 2.8.1 + + '@wry/equality@0.5.7': + dependencies: + tslib: 2.8.1 + + '@wry/trie@0.5.0': + dependencies: + tslib: 2.8.1 + '@xtuc/ieee754@1.2.0': {} '@xtuc/long@4.2.2': {} @@ -36149,6 +37320,10 @@ snapshots: ansi-styles@2.2.1: {} + ansi-styles@3.2.1: + dependencies: + color-convert: 1.9.3 + ansi-styles@4.3.0: dependencies: color-convert: 2.0.1 @@ -36870,6 +38045,8 @@ snapshots: blake2b-wasm: 1.1.7 nanoassert: 1.1.0 + blakejs@1.2.1: {} + blessed@0.1.81: {} bluebird@3.7.2: {} @@ -37176,6 +38353,11 @@ snapshots: builtin-status-codes@3.0.0: {} + bundle-require@4.2.1(esbuild@0.17.19): + dependencies: + esbuild: 0.17.19 + load-tsconfig: 0.2.5 + bundle-require@5.1.0(esbuild@0.24.2): dependencies: esbuild: 0.24.2 @@ -37377,6 +38559,12 @@ snapshots: strip-ansi: 3.0.1 supports-color: 2.0.0 + chalk@2.4.2: + dependencies: + ansi-styles: 3.2.1 + escape-string-regexp: 1.0.5 + supports-color: 5.5.0 + chalk@3.0.0: dependencies: ansi-styles: 4.3.0 @@ -37665,10 +38853,16 @@ snapshots: collect-v8-coverage@1.0.2: {} + color-convert@1.9.3: + dependencies: + color-name: 1.1.3 + color-convert@2.0.1: dependencies: color-name: 1.1.4 + color-name@1.1.3: {} + color-name@1.1.4: {} color-string@1.9.1: @@ -37941,6 +39135,16 @@ snapshots: serialize-javascript: 6.0.2 webpack: 5.97.1(@swc/core@1.10.7(@swc/helpers@0.5.15)) + copyfiles@2.4.1: + dependencies: + glob: 7.2.3 + minimatch: 3.1.2 + mkdirp: 1.0.4 + noms: 0.0.0 + through2: 2.0.5 + untildify: 4.0.0 + yargs: 16.2.0 + core-js-compat@3.40.0: dependencies: browserslist: 4.24.4 @@ -38047,43 +39251,13 @@ snapshots: safe-buffer: 5.2.1 sha.js: 2.4.11 - create-jest@29.7.0(@types/node@18.19.71)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@18.19.71)(typescript@5.6.3)): - dependencies: - '@jest/types': 29.6.3 - chalk: 4.1.2 - exit: 0.1.2 - graceful-fs: 4.2.11 - jest-config: 29.7.0(@types/node@18.19.71)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@18.19.71)(typescript@5.6.3)) - jest-util: 29.7.0 - prompts: 2.4.2 - transitivePeerDependencies: - - '@types/node' - - babel-plugin-macros - - supports-color - - ts-node - - create-jest@29.7.0(@types/node@20.17.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@20.17.9)(typescript@5.7.3)): + create-jest@29.7.0(@types/node@22.10.7)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@22.10.7)(typescript@5.7.3)): dependencies: '@jest/types': 29.6.3 chalk: 4.1.2 exit: 0.1.2 graceful-fs: 4.2.11 - jest-config: 29.7.0(@types/node@20.17.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@20.17.9)(typescript@5.7.3)) - jest-util: 29.7.0 - prompts: 2.4.2 - transitivePeerDependencies: - - '@types/node' - - babel-plugin-macros - - supports-color - - ts-node - - create-jest@29.7.0(@types/node@22.10.7)(babel-plugin-macros@3.1.0): - dependencies: - '@jest/types': 29.6.3 - chalk: 4.1.2 - exit: 0.1.2 - graceful-fs: 4.2.11 - jest-config: 29.7.0(@types/node@22.10.7)(babel-plugin-macros@3.1.0) + jest-config: 29.7.0(@types/node@22.10.7)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@22.10.7)(typescript@5.7.3)) jest-util: 29.7.0 prompts: 2.4.2 transitivePeerDependencies: @@ -38847,6 +40021,8 @@ snapshots: diff@4.0.2: {} + diff@7.0.0: {} + diffie-hellman@5.0.3: dependencies: bn.js: 4.12.1 @@ -39356,6 +40532,31 @@ snapshots: esbuild: 0.24.2 import-meta-resolve: 3.1.1 + esbuild@0.17.19: + optionalDependencies: + '@esbuild/android-arm': 0.17.19 + '@esbuild/android-arm64': 0.17.19 + '@esbuild/android-x64': 0.17.19 + '@esbuild/darwin-arm64': 0.17.19 + '@esbuild/darwin-x64': 0.17.19 + '@esbuild/freebsd-arm64': 0.17.19 + '@esbuild/freebsd-x64': 0.17.19 + '@esbuild/linux-arm': 0.17.19 + '@esbuild/linux-arm64': 0.17.19 + '@esbuild/linux-ia32': 0.17.19 + '@esbuild/linux-loong64': 0.17.19 + '@esbuild/linux-mips64el': 0.17.19 + '@esbuild/linux-ppc64': 0.17.19 + '@esbuild/linux-riscv64': 0.17.19 + '@esbuild/linux-s390x': 0.17.19 + '@esbuild/linux-x64': 0.17.19 + '@esbuild/netbsd-x64': 0.17.19 + '@esbuild/openbsd-x64': 0.17.19 + '@esbuild/sunos-x64': 0.17.19 + '@esbuild/win32-arm64': 0.17.19 + '@esbuild/win32-ia32': 0.17.19 + '@esbuild/win32-x64': 0.17.19 + esbuild@0.19.12: optionalDependencies: '@esbuild/aix-ppc64': 0.19.12 @@ -39907,6 +41108,24 @@ snapshots: dependencies: '@noble/hashes': 1.7.0 + ethereum-cryptography@0.1.3: + dependencies: + '@types/pbkdf2': 3.1.2 + '@types/secp256k1': 4.0.6 + blakejs: 1.2.1 + browserify-aes: 1.2.0 + bs58check: 2.1.2 + create-hash: 1.2.0 + create-hmac: 1.1.7 + hash.js: 1.1.7 + keccak: 3.0.4 + pbkdf2: 3.1.2 + randombytes: 2.1.0 + safe-buffer: 5.2.1 + scrypt-js: 3.0.1 + secp256k1: 4.0.4 + setimmediate: 1.0.5 + ethereum-cryptography@2.2.1: dependencies: '@noble/curves': 1.4.2 @@ -39922,6 +41141,29 @@ snapshots: '@scure/bip32': 1.5.0 '@scure/bip39': 1.4.0 + ethereumjs-abi@0.6.8: + dependencies: + bn.js: 4.12.1 + ethereumjs-util: 6.2.1 + + ethereumjs-util@6.2.1: + dependencies: + '@types/bn.js': 4.11.6 + bn.js: 4.12.1 + create-hash: 1.2.0 + elliptic: 6.6.1 + ethereum-cryptography: 0.1.3 + ethjs-util: 0.1.6 + rlp: 2.2.7 + + ethereumjs-util@7.1.5: + dependencies: + '@types/bn.js': 5.1.6 + bn.js: 5.2.1 + create-hash: 1.2.0 + ethereum-cryptography: 0.1.3 + rlp: 2.2.7 + ethers-multicall-provider@5.0.0(bufferutil@4.0.9)(lodash@4.17.21)(utf-8-validate@5.0.10): dependencies: ethers: 6.13.4(bufferutil@4.0.9)(utf-8-validate@5.0.10) @@ -40046,9 +41288,14 @@ snapshots: bn.js: 4.11.6 number-to-bn: 1.7.0 + ethjs-util@0.1.6: + dependencies: + is-hex-prefixed: 1.0.0 + strip-hex-prefix: 1.0.0 + eval@0.1.8: dependencies: - '@types/node': 20.17.9 + '@types/node': 22.10.7 require-like: 0.1.2 event-emitter@0.3.5: @@ -41571,6 +42818,8 @@ snapshots: jsprim: 1.4.2 sshpk: 1.18.0 + http-status-codes@2.3.0: {} + http2-wrapper@1.0.3: dependencies: quick-lru: 5.1.1 @@ -42336,7 +43585,7 @@ snapshots: '@jest/expect': 29.7.0 '@jest/test-result': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 20.17.9 + '@types/node': 22.10.7 chalk: 4.1.2 co: 4.6.0 dedent: 1.5.3(babel-plugin-macros@3.1.0) @@ -42356,54 +43605,16 @@ snapshots: - babel-plugin-macros - supports-color - jest-cli@29.7.0(@types/node@18.19.71)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@18.19.71)(typescript@5.6.3)): - dependencies: - '@jest/core': 29.7.0(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@18.19.71)(typescript@5.6.3)) - '@jest/test-result': 29.7.0 - '@jest/types': 29.6.3 - chalk: 4.1.2 - create-jest: 29.7.0(@types/node@18.19.71)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@18.19.71)(typescript@5.6.3)) - exit: 0.1.2 - import-local: 3.2.0 - jest-config: 29.7.0(@types/node@18.19.71)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@18.19.71)(typescript@5.6.3)) - jest-util: 29.7.0 - jest-validate: 29.7.0 - yargs: 17.7.2 - transitivePeerDependencies: - - '@types/node' - - babel-plugin-macros - - supports-color - - ts-node - - jest-cli@29.7.0(@types/node@20.17.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@20.17.9)(typescript@5.7.3)): - dependencies: - '@jest/core': 29.7.0(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@20.17.9)(typescript@5.7.3)) - '@jest/test-result': 29.7.0 - '@jest/types': 29.6.3 - chalk: 4.1.2 - create-jest: 29.7.0(@types/node@20.17.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@20.17.9)(typescript@5.7.3)) - exit: 0.1.2 - import-local: 3.2.0 - jest-config: 29.7.0(@types/node@20.17.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@20.17.9)(typescript@5.7.3)) - jest-util: 29.7.0 - jest-validate: 29.7.0 - yargs: 17.7.2 - transitivePeerDependencies: - - '@types/node' - - babel-plugin-macros - - supports-color - - ts-node - - jest-cli@29.7.0(@types/node@22.10.7)(babel-plugin-macros@3.1.0): + jest-cli@29.7.0(@types/node@22.10.7)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@22.10.7)(typescript@5.7.3)): dependencies: - '@jest/core': 29.7.0(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@20.17.9)(typescript@5.7.3)) + '@jest/core': 29.7.0(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@22.10.7)(typescript@5.7.3)) '@jest/test-result': 29.7.0 '@jest/types': 29.6.3 chalk: 4.1.2 - create-jest: 29.7.0(@types/node@22.10.7)(babel-plugin-macros@3.1.0) + create-jest: 29.7.0(@types/node@22.10.7)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@22.10.7)(typescript@5.7.3)) exit: 0.1.2 import-local: 3.2.0 - jest-config: 29.7.0(@types/node@22.10.7)(babel-plugin-macros@3.1.0) + jest-config: 29.7.0(@types/node@22.10.7)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@22.10.7)(typescript@5.7.3)) jest-util: 29.7.0 jest-validate: 29.7.0 yargs: 17.7.2 @@ -42432,7 +43643,7 @@ snapshots: - supports-color - ts-node - jest-config@29.7.0(@types/node@18.19.71)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@18.19.71)(typescript@5.6.3)): + jest-config@29.7.0(@types/node@22.10.7)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@22.10.7)(typescript@5.7.3)): dependencies: '@babel/core': 7.26.0 '@jest/test-sequencer': 29.7.0 @@ -42457,106 +43668,13 @@ snapshots: slash: 3.0.0 strip-json-comments: 3.1.1 optionalDependencies: - '@types/node': 18.19.71 - ts-node: 10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@18.19.71)(typescript@5.6.3) - transitivePeerDependencies: - - babel-plugin-macros - - supports-color - - jest-config@29.7.0(@types/node@20.17.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@18.19.71)(typescript@5.6.3)): - dependencies: - '@babel/core': 7.26.0 - '@jest/test-sequencer': 29.7.0 - '@jest/types': 29.6.3 - babel-jest: 29.7.0(@babel/core@7.26.0) - chalk: 4.1.2 - ci-info: 3.9.0 - deepmerge: 4.3.1 - glob: 7.2.3 - graceful-fs: 4.2.11 - jest-circus: 29.7.0(babel-plugin-macros@3.1.0) - jest-environment-node: 29.7.0 - jest-get-type: 29.6.3 - jest-regex-util: 29.6.3 - jest-resolve: 29.7.0 - jest-runner: 29.7.0 - jest-util: 29.7.0 - jest-validate: 29.7.0 - micromatch: 4.0.8 - parse-json: 5.2.0 - pretty-format: 29.7.0 - slash: 3.0.0 - strip-json-comments: 3.1.1 - optionalDependencies: - '@types/node': 20.17.9 - ts-node: 10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@18.19.71)(typescript@5.6.3) - transitivePeerDependencies: - - babel-plugin-macros - - supports-color - - jest-config@29.7.0(@types/node@20.17.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@20.17.9)(typescript@5.7.3)): - dependencies: - '@babel/core': 7.26.0 - '@jest/test-sequencer': 29.7.0 - '@jest/types': 29.6.3 - babel-jest: 29.7.0(@babel/core@7.26.0) - chalk: 4.1.2 - ci-info: 3.9.0 - deepmerge: 4.3.1 - glob: 7.2.3 - graceful-fs: 4.2.11 - jest-circus: 29.7.0(babel-plugin-macros@3.1.0) - jest-environment-node: 29.7.0 - jest-get-type: 29.6.3 - jest-regex-util: 29.6.3 - jest-resolve: 29.7.0 - jest-runner: 29.7.0 - jest-util: 29.7.0 - jest-validate: 29.7.0 - micromatch: 4.0.8 - parse-json: 5.2.0 - pretty-format: 29.7.0 - slash: 3.0.0 - strip-json-comments: 3.1.1 - optionalDependencies: - '@types/node': 20.17.9 - ts-node: 10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@20.17.9)(typescript@5.7.3) - transitivePeerDependencies: - - babel-plugin-macros - - supports-color - - jest-config@29.7.0(@types/node@20.17.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@22.8.4)(typescript@5.6.3)): - dependencies: - '@babel/core': 7.26.0 - '@jest/test-sequencer': 29.7.0 - '@jest/types': 29.6.3 - babel-jest: 29.7.0(@babel/core@7.26.0) - chalk: 4.1.2 - ci-info: 3.9.0 - deepmerge: 4.3.1 - glob: 7.2.3 - graceful-fs: 4.2.11 - jest-circus: 29.7.0(babel-plugin-macros@3.1.0) - jest-environment-node: 29.7.0 - jest-get-type: 29.6.3 - jest-regex-util: 29.6.3 - jest-resolve: 29.7.0 - jest-runner: 29.7.0 - jest-util: 29.7.0 - jest-validate: 29.7.0 - micromatch: 4.0.8 - parse-json: 5.2.0 - pretty-format: 29.7.0 - slash: 3.0.0 - strip-json-comments: 3.1.1 - optionalDependencies: - '@types/node': 20.17.9 - ts-node: 10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@22.8.4)(typescript@5.6.3) + '@types/node': 22.10.7 + ts-node: 10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@22.10.7)(typescript@5.7.3) transitivePeerDependencies: - babel-plugin-macros - supports-color - jest-config@29.7.0(@types/node@22.10.7)(babel-plugin-macros@3.1.0): + jest-config@29.7.0(@types/node@22.10.7)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@22.8.4)(typescript@5.6.3)): dependencies: '@babel/core': 7.26.0 '@jest/test-sequencer': 29.7.0 @@ -42582,6 +43700,7 @@ snapshots: strip-json-comments: 3.1.1 optionalDependencies: '@types/node': 22.10.7 + ts-node: 10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@22.8.4)(typescript@5.6.3) transitivePeerDependencies: - babel-plugin-macros - supports-color @@ -42619,7 +43738,7 @@ snapshots: jest-diff@29.7.0: dependencies: - chalk: 4.1.0 + chalk: 4.1.2 diff-sequences: 29.6.3 jest-get-type: 29.6.3 pretty-format: 29.7.0 @@ -42641,7 +43760,7 @@ snapshots: '@jest/environment': 29.7.0 '@jest/fake-timers': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 20.17.9 + '@types/node': 22.10.7 jest-mock: 29.7.0 jest-util: 29.7.0 @@ -42651,7 +43770,7 @@ snapshots: dependencies: '@jest/types': 29.6.3 '@types/graceful-fs': 4.1.9 - '@types/node': 20.17.9 + '@types/node': 22.10.7 anymatch: 3.1.3 fb-watchman: 2.0.2 graceful-fs: 4.2.11 @@ -42690,7 +43809,7 @@ snapshots: jest-mock@29.7.0: dependencies: '@jest/types': 29.6.3 - '@types/node': 20.17.9 + '@types/node': 22.10.7 jest-util: 29.7.0 jest-pnp-resolver@1.2.3(jest-resolve@29.7.0): @@ -42725,7 +43844,7 @@ snapshots: '@jest/test-result': 29.7.0 '@jest/transform': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 20.17.9 + '@types/node': 22.10.7 chalk: 4.1.2 emittery: 0.13.1 graceful-fs: 4.2.11 @@ -42753,7 +43872,7 @@ snapshots: '@jest/test-result': 29.7.0 '@jest/transform': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 20.17.9 + '@types/node': 22.10.7 chalk: 4.1.2 cjs-module-lexer: 1.4.1 collect-v8-coverage: 1.0.2 @@ -42799,7 +43918,7 @@ snapshots: jest-util@29.7.0: dependencies: '@jest/types': 29.6.3 - '@types/node': 20.17.9 + '@types/node': 22.10.7 chalk: 4.1.2 ci-info: 3.9.0 graceful-fs: 4.2.11 @@ -42818,7 +43937,7 @@ snapshots: dependencies: '@jest/test-result': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 20.17.9 + '@types/node': 22.10.7 ansi-escapes: 4.3.2 chalk: 4.1.2 emittery: 0.13.1 @@ -42827,47 +43946,23 @@ snapshots: jest-worker@27.5.1: dependencies: - '@types/node': 20.17.9 + '@types/node': 22.10.7 merge-stream: 2.0.0 supports-color: 8.1.1 jest-worker@29.7.0: dependencies: - '@types/node': 20.17.9 + '@types/node': 22.10.7 jest-util: 29.7.0 merge-stream: 2.0.0 supports-color: 8.1.1 - jest@29.7.0(@types/node@18.19.71)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@18.19.71)(typescript@5.6.3)): + jest@29.7.0(@types/node@22.10.7)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@22.10.7)(typescript@5.7.3)): dependencies: - '@jest/core': 29.7.0(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@18.19.71)(typescript@5.6.3)) + '@jest/core': 29.7.0(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@22.10.7)(typescript@5.7.3)) '@jest/types': 29.6.3 import-local: 3.2.0 - jest-cli: 29.7.0(@types/node@18.19.71)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@18.19.71)(typescript@5.6.3)) - transitivePeerDependencies: - - '@types/node' - - babel-plugin-macros - - supports-color - - ts-node - - jest@29.7.0(@types/node@20.17.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@20.17.9)(typescript@5.7.3)): - dependencies: - '@jest/core': 29.7.0(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@20.17.9)(typescript@5.7.3)) - '@jest/types': 29.6.3 - import-local: 3.2.0 - jest-cli: 29.7.0(@types/node@20.17.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@20.17.9)(typescript@5.7.3)) - transitivePeerDependencies: - - '@types/node' - - babel-plugin-macros - - supports-color - - ts-node - - jest@29.7.0(@types/node@22.10.7)(babel-plugin-macros@3.1.0): - dependencies: - '@jest/core': 29.7.0(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@20.17.9)(typescript@5.7.3)) - '@jest/types': 29.6.3 - import-local: 3.2.0 - jest-cli: 29.7.0(@types/node@22.10.7)(babel-plugin-macros@3.1.0) + jest-cli: 29.7.0(@types/node@22.10.7)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@22.10.7)(typescript@5.7.3)) transitivePeerDependencies: - '@types/node' - babel-plugin-macros @@ -42952,6 +44047,8 @@ snapshots: jsbn@1.1.0: {} + jscrypto@1.0.3: {} + jsdoc-type-pratt-parser@4.0.0: {} jsdom@25.0.1(bufferutil@4.0.9)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@5.0.10): @@ -43081,6 +44178,8 @@ snapshots: jsonpointer@5.0.1: {} + jsonschema@1.5.0: {} + jsonwebtoken@9.0.2: dependencies: jws: 3.2.2 @@ -43123,6 +44222,8 @@ snapshots: just-diff@6.0.2: {} + just-extend@6.2.0: {} + jwa@1.4.1: dependencies: buffer-equal-constant-time: 1.0.1 @@ -43453,12 +44554,18 @@ snapshots: lifecycle-utils@1.7.3: {} + lilconfig@2.1.0: {} + lilconfig@3.1.3: {} lines-and-columns@1.2.4: {} lines-and-columns@2.0.3: {} + link-module-alias@1.2.0: + dependencies: + chalk: 2.4.2 + linkify-it@5.0.0: dependencies: uc.micro: 2.1.0 @@ -43584,6 +44691,8 @@ snapshots: lodash.defaults@4.2.0: {} + lodash.get@4.4.2: {} + lodash.includes@4.3.0: {} lodash.isarguments@3.1.0: {} @@ -43626,6 +44735,8 @@ snapshots: lodash.upperfirst@4.3.1: {} + lodash.values@4.3.0: {} + lodash@4.17.21: {} log-symbols@4.1.0: @@ -44729,7 +45840,7 @@ snapshots: array-differ: 3.0.0 array-union: 2.1.0 arrify: 2.0.1 - minimatch: 3.0.5 + minimatch: 3.1.2 multistream@4.1.0: dependencies: @@ -44857,6 +45968,14 @@ snapshots: next-tick@1.1.0: {} + nise@6.1.1: + dependencies: + '@sinonjs/commons': 3.0.1 + '@sinonjs/fake-timers': 13.0.5 + '@sinonjs/text-encoding': 0.7.3 + just-extend: 6.2.0 + path-to-regexp: 8.2.0 + no-case@3.0.4: dependencies: lower-case: 2.0.2 @@ -45026,6 +46145,11 @@ snapshots: touch: 3.1.1 undefsafe: 2.0.5 + noms@0.0.0: + dependencies: + inherits: 2.0.4 + readable-stream: 1.0.34 + nopt@1.0.10: dependencies: abbrev: 1.1.1 @@ -45163,7 +46287,7 @@ snapshots: '@yarnpkg/parsers': 3.0.0-rc.46 '@zkochan/js-yaml': 0.0.7 axios: 1.7.9(debug@4.4.0) - chalk: 4.1.0 + chalk: 4.1.2 cli-cursor: 3.1.0 cli-spinners: 2.6.1 cliui: 8.0.1 @@ -45440,6 +46564,13 @@ snapshots: opener@1.5.2: {} + optimism@0.18.1: + dependencies: + '@wry/caches': 1.0.1 + '@wry/context': 0.7.4 + '@wry/trie': 0.5.0 + tslib: 2.8.1 + optional@0.1.4: {} optionator@0.9.4: @@ -45454,7 +46585,7 @@ snapshots: ora@5.3.0: dependencies: bl: 4.1.0 - chalk: 4.1.0 + chalk: 4.1.2 cli-cursor: 3.1.0 cli-spinners: 2.6.1 is-interactive: 1.0.0 @@ -45836,6 +46967,8 @@ snapshots: path-to-regexp@3.3.0: {} + path-to-regexp@8.2.0: {} + path-type@3.0.0: dependencies: pify: 3.0.0 @@ -46332,6 +47465,14 @@ snapshots: '@csstools/utilities': 2.0.0(postcss@8.5.1) postcss: 8.5.1 + postcss-load-config@3.1.4(postcss@8.5.1)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@18.19.71)(typescript@5.6.3)): + dependencies: + lilconfig: 2.1.0 + yaml: 1.10.2 + optionalDependencies: + postcss: 8.5.1 + ts-node: 10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@18.19.71)(typescript@5.6.3) + postcss-load-config@4.0.2(postcss@8.5.1)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@22.10.7)(typescript@5.6.3)): dependencies: lilconfig: 3.1.3 @@ -46937,7 +48078,7 @@ snapshots: '@protobufjs/pool': 1.1.0 '@protobufjs/utf8': 1.1.0 '@types/long': 4.0.2 - '@types/node': 20.17.9 + '@types/node': 22.10.7 long: 4.0.0 protobufjs@7.4.0: @@ -46952,7 +48093,7 @@ snapshots: '@protobufjs/path': 1.1.2 '@protobufjs/pool': 1.1.0 '@protobufjs/utf8': 1.1.0 - '@types/node': 20.17.9 + '@types/node': 22.10.7 long: 5.2.4 protocols@2.0.1: {} @@ -47619,6 +48760,11 @@ snapshots: dependencies: jsesc: 3.0.2 + rehackt@0.1.0(@types/react@19.0.7)(react@19.0.0): + optionalDependencies: + '@types/react': 19.0.7 + react: 19.0.0 + rehype-parse@7.0.1: dependencies: hast-util-from-parse5: 6.0.1 @@ -47803,6 +48949,10 @@ snapshots: path-parse: 1.0.7 supports-preserve-symlinks-flag: 1.0.0 + response-iterator@0.2.16: + dependencies: + readable-stream: 2.3.8 + responselike@2.0.1: dependencies: lowercase-keys: 2.0.0 @@ -47851,6 +49001,10 @@ snapshots: hash-base: 3.1.0 inherits: 2.0.4 + rlp@2.2.7: + dependencies: + bn.js: 5.2.1 + robot3@0.4.1: {} robust-predicates@3.0.2: {} @@ -48041,6 +49195,12 @@ snapshots: search-insights@2.17.3: {} + secp256k1@4.0.4: + dependencies: + elliptic: 6.6.1 + node-addon-api: 5.1.0 + node-gyp-build: 4.8.4 + secp256k1@5.0.0: dependencies: elliptic: 6.6.1 @@ -48280,6 +49440,11 @@ snapshots: shimmer@1.2.1: {} + shx@0.3.4: + dependencies: + minimist: 1.2.8 + shelljs: 0.8.5 + side-channel-list@1.0.0: dependencies: es-errors: 1.3.0 @@ -48360,6 +49525,15 @@ snapshots: dependencies: semver: 7.6.3 + sinon@19.0.2: + dependencies: + '@sinonjs/commons': 3.0.1 + '@sinonjs/fake-timers': 13.0.5 + '@sinonjs/samsam': 8.0.2 + diff: 7.0.0 + nise: 6.1.1 + supports-color: 7.2.0 + sirv@2.0.4: dependencies: '@polka/url': 1.0.0-next.28 @@ -48425,6 +49599,12 @@ snapshots: map-obj: 4.3.0 to-snake-case: 1.0.0 + snakecase-keys@5.5.0: + dependencies: + map-obj: 4.3.0 + snake-case: 3.0.4 + type-fest: 3.13.1 + socket.io-client@4.8.1(bufferutil@4.0.9)(utf-8-validate@5.0.10): dependencies: '@socket.io/component-emitter': 3.1.2 @@ -48766,6 +49946,8 @@ snapshots: steno@4.0.2: {} + store2@2.14.4: {} + stream-browserify@3.0.0: dependencies: inherits: 2.0.4 @@ -49064,6 +50246,8 @@ snapshots: symbol-observable@2.0.3: {} + symbol-observable@4.0.0: {} + symbol-tree@3.2.4: {} symbol.inspect@1.0.1: {} @@ -49493,6 +50677,10 @@ snapshots: dependencies: typescript: 5.6.3 + ts-api-utils@1.4.3(typescript@5.7.3): + dependencies: + typescript: 5.7.3 + ts-api-utils@2.0.0(typescript@5.6.3): dependencies: typescript: 5.6.3 @@ -49503,51 +50691,36 @@ snapshots: ts-interface-checker@0.1.13: {} - ts-jest@29.2.5(@babel/core@7.26.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.0))(esbuild@0.24.2)(jest@29.7.0(@types/node@20.17.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@20.17.9)(typescript@5.7.3)))(typescript@5.7.3): + ts-invariant@0.10.3: dependencies: - bs-logger: 0.2.6 - ejs: 3.1.10 - fast-json-stable-stringify: 2.1.0 - jest: 29.7.0(@types/node@20.17.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@20.17.9)(typescript@5.7.3)) - jest-util: 29.7.0 - json5: 2.2.3 - lodash.memoize: 4.1.2 - make-error: 1.3.6 - semver: 7.6.3 - typescript: 5.7.3 - yargs-parser: 21.1.1 - optionalDependencies: - '@babel/core': 7.26.0 - '@jest/transform': 29.7.0 - '@jest/types': 29.6.3 - babel-jest: 29.7.0(@babel/core@7.26.0) - esbuild: 0.24.2 + tslib: 2.8.1 - ts-jest@29.2.5(@babel/core@7.26.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.0))(jest@29.7.0(@types/node@18.19.71)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@18.19.71)(typescript@5.6.3)))(typescript@5.6.3): + ts-jest@29.2.5(@babel/core@7.26.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.0))(esbuild@0.24.2)(jest@29.7.0(@types/node@22.10.7)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@22.10.7)(typescript@5.7.3)))(typescript@5.7.3): dependencies: bs-logger: 0.2.6 ejs: 3.1.10 fast-json-stable-stringify: 2.1.0 - jest: 29.7.0(@types/node@18.19.71)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@18.19.71)(typescript@5.6.3)) + jest: 29.7.0(@types/node@22.10.7)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@22.10.7)(typescript@5.7.3)) jest-util: 29.7.0 json5: 2.2.3 lodash.memoize: 4.1.2 make-error: 1.3.6 semver: 7.6.3 - typescript: 5.6.3 + typescript: 5.7.3 yargs-parser: 21.1.1 optionalDependencies: '@babel/core': 7.26.0 '@jest/transform': 29.7.0 '@jest/types': 29.6.3 babel-jest: 29.7.0(@babel/core@7.26.0) + esbuild: 0.24.2 ts-jest@29.2.5(@babel/core@7.26.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.0))(jest@29.7.0(@types/node@22.10.7)(babel-plugin-macros@3.1.0))(typescript@5.6.3): dependencies: bs-logger: 0.2.6 ejs: 3.1.10 fast-json-stable-stringify: 2.1.0 - jest: 29.7.0(@types/node@22.10.7)(babel-plugin-macros@3.1.0) + jest: 29.7.0(@types/node@22.10.7)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@22.10.7)(typescript@5.7.3)) jest-util: 29.7.0 json5: 2.2.3 lodash.memoize: 4.1.2 @@ -49603,6 +50776,7 @@ snapshots: yn: 3.1.1 optionalDependencies: '@swc/core': 1.10.7(@swc/helpers@0.5.15) + optional: true ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@20.17.9)(typescript@5.7.3): dependencies: @@ -49718,6 +50892,30 @@ snapshots: tsscmp@1.0.6: {} + tsup@6.7.0(@swc/core@1.10.7(@swc/helpers@0.5.15))(postcss@8.5.1)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@18.19.71)(typescript@5.6.3))(typescript@5.6.3): + dependencies: + bundle-require: 4.2.1(esbuild@0.17.19) + cac: 6.7.14 + chokidar: 3.6.0 + debug: 4.4.0(supports-color@5.5.0) + esbuild: 0.17.19 + execa: 5.1.1 + globby: 11.1.0 + joycon: 3.1.1 + postcss-load-config: 3.1.4(postcss@8.5.1)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@18.19.71)(typescript@5.6.3)) + resolve-from: 5.0.0 + rollup: 3.29.5 + source-map: 0.8.0-beta.0 + sucrase: 3.35.0 + tree-kill: 1.2.2 + optionalDependencies: + '@swc/core': 1.10.7(@swc/helpers@0.5.15) + postcss: 8.5.1 + typescript: 5.6.3 + transitivePeerDependencies: + - supports-color + - ts-node + tsup@8.3.5(@swc/core@1.10.7(@swc/helpers@0.5.15))(jiti@2.4.2)(postcss@8.5.1)(tsx@4.19.2)(typescript@5.6.3)(yaml@2.7.0): dependencies: bundle-require: 5.1.0(esbuild@0.24.2) @@ -49865,6 +51063,8 @@ snapshots: type-fest@2.19.0: {} + type-fest@3.13.1: {} + type-fest@4.32.0: {} type-is@1.6.18: @@ -50223,6 +51423,8 @@ snapshots: idb-keyval: 6.2.1 ioredis: 5.4.2 + untildify@4.0.0: {} + untyped@1.5.2: dependencies: '@babel/core': 7.26.0 @@ -50576,6 +51778,24 @@ snapshots: - supports-color - terser + vite-node@1.2.1(@types/node@18.19.71)(terser@5.37.0): + dependencies: + cac: 6.7.14 + debug: 4.4.0(supports-color@5.5.0) + pathe: 1.1.2 + picocolors: 1.1.1 + vite: 5.4.11(@types/node@18.19.71)(terser@5.37.0) + transitivePeerDependencies: + - '@types/node' + - less + - lightningcss + - sass + - sass-embedded + - stylus + - sugarss + - supports-color + - terser + vite-node@1.2.1(@types/node@20.17.9)(terser@5.37.0): dependencies: cac: 6.7.14 @@ -50749,6 +51969,16 @@ snapshots: - supports-color - typescript + vite@5.4.11(@types/node@18.19.71)(terser@5.37.0): + dependencies: + esbuild: 0.21.5 + postcss: 8.5.1 + rollup: 4.30.1 + optionalDependencies: + '@types/node': 18.19.71 + fsevents: 2.3.3 + terser: 5.37.0 + vite@5.4.11(@types/node@20.17.9)(terser@5.37.0): dependencies: esbuild: 0.21.5 @@ -50868,6 +52098,42 @@ snapshots: - supports-color - terser + vitest@1.2.1(@types/node@18.19.71)(jsdom@25.0.1(bufferutil@4.0.9)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@6.0.5))(terser@5.37.0): + dependencies: + '@vitest/expect': 1.2.1 + '@vitest/runner': 1.2.1 + '@vitest/snapshot': 1.2.1 + '@vitest/spy': 1.2.1 + '@vitest/utils': 1.2.1 + acorn-walk: 8.3.4 + cac: 6.7.14 + chai: 4.5.0 + debug: 4.4.0(supports-color@5.5.0) + execa: 8.0.1 + local-pkg: 0.5.1 + magic-string: 0.30.17 + pathe: 1.1.2 + picocolors: 1.1.1 + std-env: 3.8.0 + strip-literal: 1.3.0 + tinybench: 2.9.0 + tinypool: 0.8.4 + vite: 5.4.11(@types/node@18.19.71)(terser@5.37.0) + vite-node: 1.2.1(@types/node@18.19.71)(terser@5.37.0) + why-is-node-running: 2.3.0 + optionalDependencies: + '@types/node': 18.19.71 + jsdom: 25.0.1(bufferutil@4.0.9)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@6.0.5) + transitivePeerDependencies: + - less + - lightningcss + - sass + - sass-embedded + - stylus + - sugarss + - supports-color + - terser + vitest@1.2.1(@types/node@20.17.9)(jsdom@25.0.1(bufferutil@4.0.9)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@5.0.10))(terser@5.37.0): dependencies: '@vitest/expect': 1.2.1 @@ -52058,6 +53324,12 @@ snapshots: toposort: 2.0.2 type-fest: 2.19.0 + zen-observable-ts@1.2.5: + dependencies: + zen-observable: 0.8.15 + + zen-observable@0.8.15: {} + zimmerframe@1.1.2: {} zksync-ethers@6.15.3(ethers@6.13.4(bufferutil@4.0.9)(utf-8-validate@6.0.5)):